Class: MaimaiNet::UserOption::Choice
- Inherits:
-
Struct
- Object
- Struct
- MaimaiNet::UserOption::Choice
- Defined in:
- lib/maimai_net/user_option.rb
Instance Attribute Summary collapse
-
#alias_symbol ⇒ Object
readonly
Returns the value of attribute alias_symbol.
-
#alias_value ⇒ Object
readonly
Returns the value of attribute alias_value.
-
#description ⇒ Object
Returns the value of attribute description.
-
#group ⇒ Object
Returns the value of attribute group.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Choice
constructor
A new instance of Choice.
- #match?(value) ⇒ Boolean
- #matches ⇒ Object
Constructor Details
#initialize(*args) ⇒ Choice
37 38 39 40 41 42 |
# File 'lib/maimai_net/user_option.rb', line 37 def initialize(*args) super @alias_symbol = symbol_alias_of @alias_value = value_alias_of end |
Instance Attribute Details
#alias_symbol ⇒ Object (readonly)
Returns the value of attribute alias_symbol.
44 45 46 |
# File 'lib/maimai_net/user_option.rb', line 44 def alias_symbol @alias_symbol end |
#alias_value ⇒ Object (readonly)
Returns the value of attribute alias_value.
44 45 46 |
# File 'lib/maimai_net/user_option.rb', line 44 def alias_value @alias_value end |
#description ⇒ Object
Returns the value of attribute description
31 32 33 |
# File 'lib/maimai_net/user_option.rb', line 31 def description @description end |
#group ⇒ Object
Returns the value of attribute group
31 32 33 |
# File 'lib/maimai_net/user_option.rb', line 31 def group @group end |
#value ⇒ Object
Returns the value of attribute value
31 32 33 |
# File 'lib/maimai_net/user_option.rb', line 31 def value @value end |
Instance Method Details
#match?(value) ⇒ Boolean
51 52 53 |
# File 'lib/maimai_net/user_option.rb', line 51 def match?(value) matches.include?(value) end |
#matches ⇒ Object
46 47 48 49 |
# File 'lib/maimai_net/user_option.rb', line 46 def matches description_value = !@alias_value.nil? ? description : nil [self.value, description_value, @alias_symbol, @alias_value].compact.uniq end |