class Irc::Bot::Config::EnumValue
Public Class Methods
Source
# File lib/rbot/config.rb, line 201 def initialize(key, params) super @values = params[:values] end
Calls superclass method
Irc::Bot::Config::Value::new
Public Instance Methods
Source
# File lib/rbot/config.rb, line 218 def desc _("%{desc} [valid values are: %{values}]") % {:desc => @desc, :values => values.join(', ')} end
Source
# File lib/rbot/config.rb, line 212 def parse(string) unless values.include?(string) raise ArgumentError, "invalid value #{string}, allowed values are: " + values.join(", ") end string end
Source
# File lib/rbot/config.rb, line 205 def values if @values.instance_of?(Proc) return @values.call(@manager.bot) else return @values end end