Class: Veezi::API::Base

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

Direct Known Subclasses

Films, Sessions, WebSessions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Base

Returns a new instance of Base.



10
11
12
13
# File 'lib/veezi/api/base.rb', line 10

def initialize(client)
  @client = client
  @parser = Veezi::API::Parser.new(self.client.configuration.content_type)
end

Instance Attribute Details

#api_pathObject

Returns the value of attribute api_path.



6
7
8
# File 'lib/veezi/api/base.rb', line 6

def api_path
  @api_path
end

#clientObject (readonly)

Returns the value of attribute client.



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

def client
  @client
end

#parserObject (readonly)

Returns the value of attribute parser.



8
9
10
# File 'lib/veezi/api/base.rb', line 8

def parser
  @parser
end

Instance Method Details

#allObject



15
16
17
18
# File 'lib/veezi/api/base.rb', line 15

def all
  response = request(:get, self.base_url)
  self.parser.parse(response)
end

#find(id) ⇒ Object



20
21
22
23
# File 'lib/veezi/api/base.rb', line 20

def find(id)
  response = request(:get, "#{self.base_url}/#{id}")
  self.parser.parse(response)
end