Module: MoneyOnline

Extended by:
MoneyOnline
Included in:
MoneyOnline
Defined in:
lib/money_online.rb,
lib/money_online/config.rb,
lib/money_online/request.rb,
lib/money_online/version.rb,
lib/money_online/response.rb

Defined Under Namespace

Classes: Config, Request, Response

Constant Summary collapse

VERSION =
"0.0.3"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#config_pathObject

Returns the value of attribute config_path.



12
13
14
# File 'lib/money_online.rb', line 12

def config_path
  @config_path
end

Instance Method Details

#build_query(params) ⇒ Object



18
19
20
21
22
# File 'lib/money_online.rb', line 18

def build_query(params)
  params.map do |key, value|
    "#{escape(key)}=#{escape(value)}" if value
  end.compact.join("&")
end

#configObject



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

def config
  @config ||= MoneyOnline::Config.new(config_hash)
end

#config_hashObject



28
29
30
# File 'lib/money_online.rb', line 28

def config_hash
  YAML.load_file(config_path)
end

#escape(string) ⇒ Object



24
25
26
# File 'lib/money_online.rb', line 24

def escape(string)
  URI.encode_www_form_component(string)
end