Module: Transcriber::Resource::Response::ClassMethods

Defined in:
lib/transcriber/resource/response.rb

Instance Method Summary collapse

Instance Method Details

#normalize(model, options = {}) ⇒ Object Also known as: resources



34
35
36
37
38
# File 'lib/transcriber/resource/response.rb', line 34

def normalize(model, options = {})
  model.kind_of?(Enumerable) ?
    {entries: model.map {|m| m.resource(options.merge(summarize: true))}}
   : model.resource(options)
end

#transcribe(input, options = {}) ⇒ Object



42
43
44
# File 'lib/transcriber/resource/response.rb', line 42

def transcribe(input, options = {})
  normalize(parse(input, options), options)
end