Sha256: c62f52ffa16697543ed4d3fad51cd6240e42c89c94c3348e2b62edd60152a9ea
Contents?: true
Size: 533 Bytes
Versions: 62
Compression:
Stored size: 533 Bytes
Contents
require 'hobo_fields/types/enum_string' module HoboFields class FieldDeclarationDsl < BlankSlate include HoboFields::Types::EnumString::DeclarationHelper 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.first, *args.rest) end end end
Version data entries
62 entries across 62 versions & 1 rubygems
Version | Path |
---|---|
hobo_fields-1.3.0.pre11 | lib/hobo_fields/field_declaration_dsl.rb |
hobo_fields-1.3.0.pre10 | lib/hobo_fields/field_declaration_dsl.rb |