Class: GlipSdk::REST::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rc_sdk) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
# File 'lib/glip_sdk/rest/client.rb', line 10

def initialize(rc_sdk)
  @api = rc_sdk
  @logger = @api.config.logger
  @groups = GlipSdk::REST::Groups.new @api
  @persons = GlipSdk::REST::Persons.new @api
  @posts = GlipSdk::REST::Posts.new @api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



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

def api
  @api
end

#groupsObject

Returns the value of attribute groups.



6
7
8
# File 'lib/glip_sdk/rest/client.rb', line 6

def groups
  @groups
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/glip_sdk/rest/client.rb', line 5

def logger
  @logger
end

#personsObject

Returns the value of attribute persons.



7
8
9
# File 'lib/glip_sdk/rest/client.rb', line 7

def persons
  @persons
end

#postsObject

Returns the value of attribute posts.



8
9
10
# File 'lib/glip_sdk/rest/client.rb', line 8

def posts
  @posts
end

Instance Method Details

#load_groupsObject



18
19
20
21
22
# File 'lib/glip_sdk/rest/client.rb', line 18

def load_groups
  res = @groups.get.http.get 'glip/groups'
  @groups_cache = GlipSdk::REST::Cache::Groups.new
  @groups.load_groups(res.body['records'])
end