Class: Groupy::Value
- Inherits:
-
Object
- Object
- Groupy::Value
- Defined in:
- lib/groupy.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name) ⇒ Value
constructor
A new instance of Value.
- #values ⇒ Object
Constructor Details
#initialize(name) ⇒ Value
Returns a new instance of Value.
122 123 124 125 |
# File 'lib/groupy.rb', line 122 def initialize(name) @name = name.to_s.gsub("::", "").underscore.to_sym @value = name.to_s.freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
126 127 128 |
# File 'lib/groupy.rb', line 126 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
126 127 128 |
# File 'lib/groupy.rb', line 126 def value @value end |
Instance Method Details
#values ⇒ Object
128 129 130 |
# File 'lib/groupy.rb', line 128 def values [value] end |