Module: Ivapi::Configuration

Included in:
Ivapi, Client
Defined in:
lib/ivapi/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def api_endpoint
  @api_endpoint
end

#connection_optionsObject

Returns the value of attribute connection_options.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def connection_options
  @connection_options
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def password
  @password
end

#server_idObject

Returns the value of attribute server_id.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def server_id
  @server_id
end

#user_agentObject

Returns the value of attribute user_agent.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def user_agent
  @user_agent
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def username
  @username
end

#web_endpointObject

Returns the value of attribute web_endpoint.



6
7
8
# File 'lib/ivapi/configuration.rb', line 6

def web_endpoint
  @web_endpoint
end

Class Method Details

.keysObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ivapi/configuration.rb', line 9

def self.keys
  @keys ||= [
    :api_endpoint,
    :server_id,
    :username,
    :middleware,
    :password,
    :user_agent,
    :connection_options
  ]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



21
22
23
24
# File 'lib/ivapi/configuration.rb', line 21

def configure
  yield self
  true
end

#reset!Object Also known as: setup

Reset configuration options to default values



27
28
29
30
31
32
# File 'lib/ivapi/configuration.rb', line 27

def reset!
  Ivapi::Configuration.keys.each do |key|
    instance_variable_set(:"@#{key}", Ivapi::Default.options[key])
  end
  self
end