Module: Transcriber::Resource::Response::ClassMethods
- Defined in:
- lib/transcriber/resource/response.rb
Instance Method Summary collapse
- #normalize(model, options = {}) ⇒ Object (also: #resources)
- #transcribe(input, options = {}) ⇒ Object
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, = {}) model.kind_of?(Enumerable) ? {entries: model.map {|m| m.resource(.merge(summarize: true))}} : model.resource() end |
#transcribe(input, options = {}) ⇒ Object
42 43 44 |
# File 'lib/transcriber/resource/response.rb', line 42 def transcribe(input, = {}) normalize(parse(input, ), ) end |