Class: Hipflag::Client

Inherits:
Object
  • Object
show all
Includes:
Flag
Defined in:
lib/hipflag/client.rb,
lib/hipflag/client/flag.rb

Defined Under Namespace

Modules: Flag

Constant Summary collapse

NotFound =
Class.new(RuntimeError)
ServerError =
Class.new(RuntimeError)
Unauthorized =
Class.new(RuntimeError)
UnprocessableEntity =
Class.new(RuntimeError)
BASE_URL =
'https://api.hipflag.com/v1/'
TIMEOUT =
10

Instance Method Summary collapse

Methods included from Flag

#flag, #update_flag

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



17
18
19
20
21
22
23
# File 'lib/hipflag/client.rb', line 17

def initialize(options = {})
  Configurable::OPTIONS.each do |key|
    instance_variable_set(:"@#{key}", options[key] || Hipflag.send(key))
  end

  http_client.base_url = BASE_URL
end