Module: FmRest::Spyke::Model::ContainerFields
- Extended by:
- ActiveSupport::Concern
- Included in:
- FmRest::Spyke::Model
- Defined in:
- lib/fmrest/spyke/model/container_fields.rb
Overview
This module adds support for container fields.
Class Method Summary collapse
-
.container(name, options = {}) ⇒ Object
Defines a container field on the model.
Class Method Details
.container(name, options = {}) ⇒ Object
Defines a container field on the model.
27 28 29 30 31 32 33 34 |
# File 'lib/fmrest/spyke/model/container_fields.rb', line 27 def container(name, = {}) field_name = [:field_name] || name define_method(name) do @container_fields ||= {} @container_fields[name.to_sym] ||= ContainerField.new(self, field_name) end end |