Class: LemonWay::Client
- Inherits:
-
Object
- Object
- LemonWay::Client
- Defined in:
- lib/lemon_way/client.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- @@api_method_calls =
%w( FastPay GetBalances GetKycStatus GetMoneyInIBANDetails GetMoneyInTransDetails GetMoneyOutTransDetails GetPaymentDetails GetWalletDetails MoneyIn MoneyIn3DConfirm MoneyIn3DInit MoneyInWebInit MoneyInWithCardId MoneyOut RefundMoneyIn RegisterCard RegisterIBAN RegisterWallet SendPayment UnregisterCard UpdateWalletDetails UploadFile )
Instance Attribute Summary collapse
-
#entity_expansion_text_limit ⇒ Object
readonly
Returns the value of attribute entity_expansion_text_limit.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#xml_mini_backend ⇒ Object
readonly
Returns the value of attribute xml_mini_backend.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
- #method_missing(*args, &block) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
37 38 39 40 41 42 |
# File 'lib/lemon_way/client.rb', line 37 def initialize opts = {} = opts.symbolize_keys!.except(:uri, :xml_mini_backend).camelize_keys @uri = URI.parse opts[:uri] @xml_mini_backend = opts[:xml_mini_backend] || ActiveSupport::XmlMini_REXML @entity_expansion_text_limit = opts[:entity_expansion_text_limit] || 10**20 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/lemon_way/client.rb', line 44 def method_missing *args, &block camelized_method_name = args.first.to_s.camelize if @@api_method_calls.include? camelized_method_name attrs = args. query camelized_method_name, attrs, &block else super end end |
Instance Attribute Details
#entity_expansion_text_limit ⇒ Object (readonly)
Returns the value of attribute entity_expansion_text_limit.
35 36 37 |
# File 'lib/lemon_way/client.rb', line 35 def entity_expansion_text_limit @entity_expansion_text_limit end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
35 36 37 |
# File 'lib/lemon_way/client.rb', line 35 def end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
35 36 37 |
# File 'lib/lemon_way/client.rb', line 35 def uri @uri end |
#xml_mini_backend ⇒ Object (readonly)
Returns the value of attribute xml_mini_backend.
35 36 37 |
# File 'lib/lemon_way/client.rb', line 35 def xml_mini_backend @xml_mini_backend end |