module FmRest::Spyke::Model::ContainerFields
This module adds support for container fields.
Public Instance Methods
container(name, options = {})
click to toggle source
Defines a container field on the model.
@param name [Symbol] the name of the container field
@option options [String] :field_name (nil) the name of the container
field in the FileMaker layout (only needed if it doesn't match the name given)
@example
class Honeybee < FmRest::Spyke::Base container :photo, field_name: "Beehive Photo ID" end
# File lib/fmrest/spyke/model/container_fields.rb, line 27 def container(name, options = {}) field_name = options[:field_name] || name define_method(name) do @container_fields ||= {} @container_fields[name.to_sym] ||= ContainerField.new(self, field_name) end end