Class: RailsAttrEnum::Attr

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

Overview

Represent an attribute

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rails_attr_enum/attr.rb', line 4

def name
  @name
end