Class: Transcriber::Resource::Embeddable

Inherits:
Association show all
Includes:
Parser, Response
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

Attributes inherited from Association

#many

Attributes inherited from Key

#model, #name, #options, #summarize

Instance Method Summary collapse

Methods included from Response

#link, #resource, #resource_keys, #summarize?

Methods included from Parser

#parse, #parse!

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, options = {})
  super

  if fields = options[:fields]
    @class_name = :array
    @fields = fields
  end
end

Instance Attribute Details

#fieldsObject

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

Returns:



20
21
22
# File 'lib/transcriber/resource/key/embeddable.rb', line 20

def raw?
  [Hash, Array].include?(resource_class)
end