Class: RailsAttrEnum::Attr
- Inherits:
-
Object
- Object
- RailsAttrEnum::Attr
- Defined in:
- lib/rails_attr_enum/attr.rb
Overview
Represent an attribute
Instance Attribute Summary collapse
-
#enum_name ⇒ Object
readonly
Returns the value of attribute enum_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Attr
constructor
A new instance of Attr.
Constructor Details
#initialize(name) ⇒ Attr
Returns a new instance of Attr.
6 7 8 9 |
# File 'lib/rails_attr_enum/attr.rb', line 6 def initialize(name) @name = name.to_s @enum_name = @name.camelize end |
Instance Attribute Details
#enum_name ⇒ Object (readonly)
Returns the value of attribute enum_name.
4 5 6 |
# File 'lib/rails_attr_enum/attr.rb', line 4 def enum_name @enum_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/rails_attr_enum/attr.rb', line 4 def name @name end |