Class: Immutabler::DSL::EnumAttributesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/immutabler/dsl/enum_attributes_builder.rb

Instance Method Summary collapse

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