Class: Transcriber::Resource::Embeddable
- Inherits:
-
Association
- Object
- Key
- Association
- Transcriber::Resource::Embeddable
- Defined in:
- lib/transcriber/resource/key/embeddable.rb,
lib/transcriber/resource/key/embeddable/parser.rb,
lib/transcriber/resource/key/embeddable/builder.rb,
lib/transcriber/resource/key/embeddable/response.rb
Defined Under Namespace
Modules: Builder, Parser, Response
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
Attributes inherited from Association
Attributes inherited from Key
#model, #name, #options, #summarize
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Embeddable
constructor
A new instance of Embeddable.
- #raw? ⇒ Boolean
Methods included from Response
#link, #resource, #resource_keys, #summarize?
Methods included from Parser
Methods inherited from Association
#create_from_hash, #default_class_name, #from_hash, #many?, #one?, #resource_class, #update_from_hash
Methods inherited from Key
#convert_input_keys, #input_path, #present?, #root_path?, #visible?
Constructor Details
#initialize(name, options = {}) ⇒ Embeddable
Returns a new instance of Embeddable.
11 12 13 14 15 16 17 18 |
# File 'lib/transcriber/resource/key/embeddable.rb', line 11 def initialize(name, = {}) super if fields = [:fields] @class_name = :array @fields = fields end end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
9 10 11 |
# File 'lib/transcriber/resource/key/embeddable.rb', line 9 def fields @fields end |
Instance Method Details
#raw? ⇒ Boolean
20 21 22 |
# File 'lib/transcriber/resource/key/embeddable.rb', line 20 def raw? [Hash, Array].include?(resource_class) end |