class HoboFields::FieldDeclarationDsl

Attributes

model[R]

Public Class Methods

new(model) click to toggle source
# File lib/hobo_fields/field_declaration_dsl.rb, line 9
def initialize(model)
  @model = model
end

Public Instance Methods

field(name, type, *args) click to toggle source
# File lib/hobo_fields/field_declaration_dsl.rb, line 22
def field(name, type, *args)
  @model.declare_field(name, type, *args)
end
method_missing(name, *args) click to toggle source
# File lib/hobo_fields/field_declaration_dsl.rb, line 27
def method_missing(name, *args)
  field(name, args.first, *args.rest)
end
timestamps() click to toggle source
# File lib/hobo_fields/field_declaration_dsl.rb, line 16
def timestamps
  field(:created_at, :datetime)
  field(:updated_at, :datetime)
end