Sha256: fb2005ed80e898811d9ca3293732576df479c39ff116668fa9090f363d7e4387

Contents?: true

Size: 357 Bytes

Versions: 18

Compression:

Stored size: 357 Bytes

Contents

require_relative 'enum_attribute'

module Immutabler
  module DSL
    class EnumAttributesBuilder
      def initialize(attributes, prefix, &block)
        @attributes = attributes
        @prefix = prefix
        instance_eval(&block)
      end

      def attr(name)
        @attributes << EnumAttribute.new("#{@prefix}#{name}")
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
immutabler-0.3.0 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.6 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.5 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.4 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.3 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.2 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.1 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.2.0 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.9 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.8 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.7 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.6 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.5 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.4 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.3 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.2 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.1 lib/immutabler/dsl/enum_attributes_builder.rb
immutabler-0.1.0 lib/immutabler/dsl/enum_attributes_builder.rb