module FrOData::Service::Response::JSON
Public Instance Methods
error_message()
click to toggle source
# File lib/frodata/service/response/json.rb, line 17 def error_message result_json['error'].andand['message'] end
next_page()
click to toggle source
# File lib/frodata/service/response/json.rb, line 9 def next_page result_json['@odata.nextLink'] end
next_page_url()
click to toggle source
# File lib/frodata/service/response/json.rb, line 13 def next_page_url next_page.gsub(service.service_url, '') end
parse_entity(entity_json, entity_options)
click to toggle source
# File lib/frodata/service/response/json.rb, line 5 def parse_entity(entity_json, entity_options) FrOData::Entity.from_json(entity_json, entity_options) end
parsed_body()
click to toggle source
# File lib/frodata/service/response/json.rb, line 21 def parsed_body result_json end
Private Instance Methods
find_entities()
click to toggle source
# File lib/frodata/service/response/json.rb, line 35 def find_entities single_entity? ? [result_json] : result_json['value'] end
result_json()
click to toggle source
# File lib/frodata/service/response/json.rb, line 27 def result_json @result_json ||= ::JSON.parse(response.body) end
single_entity?()
click to toggle source
# File lib/frodata/service/response/json.rb, line 31 def single_entity? result_json['@odata.context'] =~ /\$entity$/ end