Class: ReviewsCatcher::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/reviews_catcher/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_id: 'my_app_id', api_key: 'my_api_key') ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
11
12
13
# File 'lib/reviews_catcher/client.rb', line 6

def initialize(app_id: 'my_app_id', api_key: 'my_api_key')
  @app_id = app_id
  @api_key = api_key

  validate_credentials!

  @base_url = build_base_url
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



4
5
6
# File 'lib/reviews_catcher/client.rb', line 4

def api_key
  @api_key
end

#app_idObject (readonly)

Returns the value of attribute app_id.



4
5
6
# File 'lib/reviews_catcher/client.rb', line 4

def app_id
  @app_id
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



4
5
6
# File 'lib/reviews_catcher/client.rb', line 4

def base_url
  @base_url
end

Instance Method Details

#accountObject



15
16
17
# File 'lib/reviews_catcher/client.rb', line 15

def 
  @account ||= ReviewsCatcher::Account.new(self)
end

#reviewsObject



19
20
21
# File 'lib/reviews_catcher/client.rb', line 19

def reviews
  @reviews ||= ReviewsCatcher::Reviews.new(self)
end