lib/dynamoid/fields.rb
# Specify a field for a document. Its type determines how it is coerced when read in and out of the datastore: 
# default is string, but you can also specify :integer, :float, :set, :array, :datetime, and :serialized.
#
# @param [Symbol] name the name of the field
# @param [Symbol] type the type of the field (one of :integer, :float, :set, :array, :datetime, or :serialized)
# @param [Hash] options any additional options for the field
#
# @since 0.2.0
Specify a field for a document.
Specify a field for a document .
def field(name, type = :string, options = {})
        named = name.to_s
        self.attributes[name] = {:type => type}.merge(options)
        define_method(named) { read_attribute(named) }
        define_method("#{named}?") { !read_attribute(named).nil? }
        define_method("#{named}=") {|value| write_attribute(named, value) }
      end
def field ( name , type = :string , options = { } ) named = name . to_s self . attributes [ name ] = { :type => type } . merge ( options ) define_method ( named ) { read_attribute ( named ) } define_method ( "#{named}?" ) { ! read_attribute ( named ) . nil? } define_method ( "#{named}=" ) { | value | write_attribute ( named , value ) } end
Specify a field for a document.
Specify a field for a document .
name
<not_specific>
type
<not_specific>
options
<not_specific>
<not_specific>
options any additional options for the field
options any additional options for the field
since
None