Module: Arke::Resource::Fields::ClassMethods

Defined in:
lib/arke/resource/fields.rb

Instance Method Summary collapse

Instance Method Details

#field(name, options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/arke/resource/fields.rb', line 9

def field(name, options={})
  raise Errors::MissingType.new('The field type is required when defining a field.') unless options[:type]
  define_getter(name.to_s, options[:type])
  define_setter(name.to_s, options[:type])
end