Class: Immutabler::DSL::EnumAttributesBuilder
- Inherits:
-
Object
- Object
- Immutabler::DSL::EnumAttributesBuilder
- Defined in:
- lib/immutabler/dsl/enum_attributes_builder.rb
Instance Method Summary collapse
- #attr(name) ⇒ Object
-
#initialize(attributes, prefix, &block) ⇒ EnumAttributesBuilder
constructor
A new instance of EnumAttributesBuilder.
Constructor Details
#initialize(attributes, prefix, &block) ⇒ EnumAttributesBuilder
Returns a new instance of EnumAttributesBuilder.
6 7 8 9 10 |
# File 'lib/immutabler/dsl/enum_attributes_builder.rb', line 6 def initialize(attributes, prefix, &block) @attributes = attributes @prefix = prefix instance_eval(&block) end |
Instance Method Details
#attr(name) ⇒ Object
12 13 14 |
# File 'lib/immutabler/dsl/enum_attributes_builder.rb', line 12 def attr(name) @attributes << EnumAttribute.new("#{@prefix}#{name}") end |