Class: FellowshipOne::ApiReader

Inherits:
Object
  • Object
show all
Defined in:
lib/readers/api_reader.rb

Overview

This adapter is the standard for all loading objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/readers/api_reader.rb', line 5

def headers
  @headers
end

Instance Method Details

#load_feedObject

Loads the list

Returns:

  • the data loaded in a JSON object.



18
19
20
21
# File 'lib/readers/api_reader.rb', line 18

def load_feed
  @url_data_params ||= {}
  return _load_data(@url_data_path, @url_data_params)
end

#load_newObject

Retrieve an empty resource with the proper structure.

Returns:

  • a new empty resource.



10
11
12
13
# File 'lib/readers/api_reader.rb', line 10

def load_new
  return if @url_new_data_path.nil?
  return _load_data(@url_new_data_path, {})
end