Module: Veritrans::Config
Instance Method Summary collapse
- #api_host ⇒ Object
- #api_host=(value) ⇒ Object
- #client_key ⇒ Object
- #client_key=(value) ⇒ Object
- #inspect ⇒ Object
- #load_config(filename) ⇒ Object (also: #load_yml)
- #server_key ⇒ Object
- #server_key=(value) ⇒ Object
Instance Method Details
#api_host ⇒ Object
26 27 28 |
# File 'lib/veritrans/config.rb', line 26 def api_host @api_host end |
#api_host=(value) ⇒ Object
30 31 32 |
# File 'lib/veritrans/config.rb', line 30 def api_host=(value) @api_host = value end |
#client_key ⇒ Object
10 11 12 |
# File 'lib/veritrans/config.rb', line 10 def client_key @client_key end |
#client_key=(value) ⇒ Object
14 15 16 |
# File 'lib/veritrans/config.rb', line 14 def client_key=(value) @client_key = value end |
#inspect ⇒ Object
47 48 49 |
# File 'lib/veritrans/config.rb', line 47 def inspect "<Veritrans::Config @api_host=#{@api_host.inspect} @server_key=#{@server_key.inspect} @client_key=#{@client_key.inspect}>" end |
#load_config(filename) ⇒ Object Also known as: load_yml
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/veritrans/config.rb', line 34 def load_config(filename) yml_file, yml_section = filename.to_s.split('#') config_data = YAML.load(File.read(yml_file)) if defined?(Rails) && !yml_section yml_section = Rails.env.to_s end apply(yml_section ? config_data[yml_section] : config_data) end |
#server_key ⇒ Object
18 19 20 |
# File 'lib/veritrans/config.rb', line 18 def server_key @server_key end |
#server_key=(value) ⇒ Object
22 23 24 |
# File 'lib/veritrans/config.rb', line 22 def server_key=(value) @server_key = value end |