Sha256: 85cfb802e1b04505f02e2ed744a6cf78e7783228a71f6aa1561f05fc3992209b

Contents?: true

Size: 413 Bytes

Versions: 28

Compression:

Stored size: 413 Bytes

Contents

module HoboFields

  class FieldDeclarationDsl < BlankSlate

    def initialize(model)
      @model = model
    end

    attr_reader :model


    def timestamps
      field(:created_at, :datetime)
      field(:updated_at, :datetime)
    end


    def field(name, type, *args)
      @model.declare_field(name, type, *args)
    end


    def method_missing(name, *args)
      field(name, *args)
    end

  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hobofields-1.1.0 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.0.3 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.1.0.pre4 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.1.0.pre3 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.1.0.pre2 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.1.0.pre0 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.0.2 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.0.1 lib/hobo_fields/field_declaration_dsl.rb
hobofields-1.0.0 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.106 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.105 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.104 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.103 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.102 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.101 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.100 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.9.0 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.8.10 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.8.9 lib/hobo_fields/field_declaration_dsl.rb
hobofields-0.8.8 lib/hobo_fields/field_declaration_dsl.rb