Class: PuntosPoint::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/puntospoint/config.rb

Overview

Configuration variables wsdl_url, api user, api password

Constant Summary collapse

BASE_WSDL_URL =
'http://dev.puntospoint.com/api/cmr/events/wsdl'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env = nil) ⇒ Config

Public: Loads the configuration file puntospoint.yml If it’s a rails application it will take the file from the config/ directory

env - Environment.

Returns a Config object.



16
17
18
19
20
21
22
23
24
25
# File 'lib/puntospoint/config.rb', line 16

def initialize(env = nil)
  if env
    # For non-rails apps
    @config_filepath = File.join(File.dirname(__FILE__), "..", "..", "config", "puntospoint.yml")
    load(env)
  else
    @config_filepath = File.join(Rails.root, "config", "puntospoint.yml")
    load(Rails.env)
  end
end

Instance Attribute Details

#api_passwordObject

Returns the value of attribute api_password.



8
9
10
# File 'lib/puntospoint/config.rb', line 8

def api_password
  @api_password
end

#api_userObject

Returns the value of attribute api_user.



8
9
10
# File 'lib/puntospoint/config.rb', line 8

def api_user
  @api_user
end

#config_filepathObject

Returns the value of attribute config_filepath.



8
9
10
# File 'lib/puntospoint/config.rb', line 8

def config_filepath
  @config_filepath
end

#wsdl_urlObject

Returns the value of attribute wsdl_url.



8
9
10
# File 'lib/puntospoint/config.rb', line 8

def wsdl_url
  @wsdl_url
end