Class: Socialfred::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/socialfred/api.rb

Constant Summary collapse

API_URL =
'https://api.socialfred.com/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_url: API_URL) ⇒ Api

Returns a new instance of Api.



11
12
13
14
# File 'lib/socialfred/api.rb', line 11

def initialize(api_key, api_url: API_URL)
  @api_key = api_key
  @api_url = api_url
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



7
8
9
# File 'lib/socialfred/api.rb', line 7

def api_key
  @api_key
end

#api_urlObject (readonly)

Returns the value of attribute api_url.



7
8
9
# File 'lib/socialfred/api.rb', line 7

def api_url
  @api_url
end

Instance Method Details

#publicationsObject



16
17
18
# File 'lib/socialfred/api.rb', line 16

def publications
  @publications ||= Publications.new(api_key, api_url: api_url)
end