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