class Textualize::TwoHundred

Public Instance Methods

transform() click to toggle source
# File lib/textualize/tasks/helpers/transformers/two_hundred.rb, line 8
def transform
  transformed_hash = {}

  transformed_hash[:response_code] = response.keys.first.to_i

  transformed_hash[:body] = fetch_example

  return transformed_hash
end

Private Instance Methods

fetch_example() click to toggle source
# File lib/textualize/tasks/helpers/transformers/two_hundred.rb, line 20
def fetch_example
  string_body = response.
    fetch('200').
    fetch('body').
    fetch('application/json').
    fetch('example')

  JSON.parse(string_body)
end