Class: Obecon::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/obecon/client.rb

Constant Summary collapse

USER_AGENT =
"ASK HELMUT Oberbaum Concept Client #{VERSION}"
MOVIE_PARAM_NAME =
"id"
DEFAULT_OPTIONS =
{
  host: "www.rce-event.de",
  path: "/api/filepool.php",
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.

Raises:

  • (ArgumentError)


17
18
19
20
# File 'lib/obecon/client.rb', line 17

def initialize(options = {})
  store_options(options)
  raise ArgumentError, "A token must be present" if token.nil?
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



14
15
16
# File 'lib/obecon/client.rb', line 14

def options
  @options
end

Instance Method Details

#hostObject

accessors for options



30
31
32
# File 'lib/obecon/client.rb', line 30

def host
  @options[:host]
end

#movie(movie_id) ⇒ Object



22
23
24
25
26
# File 'lib/obecon/client.rb', line 22

def movie(movie_id)
  handle_response do
    self.class.get(build_query(movie_id)).body
  end
end

#pathObject



34
35
36
# File 'lib/obecon/client.rb', line 34

def path
  @options[:path]
end

#tokenObject



38
39
40
# File 'lib/obecon/client.rb', line 38

def token
  @options[:token]
end