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.
131 132 133 134 |
# File 'lib/groupy.rb', line 131 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.
135 136 137 |
# File 'lib/groupy.rb', line 135 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
135 136 137 |
# File 'lib/groupy.rb', line 135 def value @value end |
Instance Method Details
#values ⇒ Object
137 138 139 |
# File 'lib/groupy.rb', line 137 def values [value] end |