Class: Groupy::Value

Inherits:
Object
  • Object
show all
Defined in:
lib/groupy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



135
136
137
# File 'lib/groupy.rb', line 135

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



135
136
137
# File 'lib/groupy.rb', line 135

def value
  @value
end

Instance Method Details

#valuesObject



137
138
139
# File 'lib/groupy.rb', line 137

def values
  [value]
end