Class: ZipMoney::Configure
- Inherits:
-
Object
- Object
- ZipMoney::Configure
- Includes:
- Request
- Defined in:
- lib/zipMoney/api/configure.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Attributes included from Request
Instance Method Summary collapse
-
#do ⇒ Object
Performs the Configure api call on zipMoney endpoint.
-
#initialize ⇒ Configure
constructor
Initializes a ZipMoney::Configure object.
-
#validate ⇒ Object
Performs the parameters validation.
Methods included from Request
Constructor Details
#initialize ⇒ Configure
Initializes a ZipMoney::Configure object
Returns ZipMoney::Configure object
12 13 14 15 16 |
# File 'lib/zipMoney/api/configure.rb', line 12 def initialize @params = Struct::ConfigureParams.new @params. = Struct::Metadata.new @params.version = Struct::Version.new end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/zipMoney/api/configure.rb', line 5 def params @params end |
Instance Method Details
#do ⇒ Object
Performs the Configure api call on zipMoney endpoint
Returns ZipMoney::Configure object
21 22 23 24 |
# File 'lib/zipMoney/api/configure.rb', line 21 def do validate ZipMoney.api.configure(self.params) end |
#validate ⇒ Object
Performs the parameters validation
27 28 29 30 31 32 |
# File 'lib/zipMoney/api/configure.rb', line 27 def validate raise ArgumentError, "Params emtpy" if params.nil? @errors = [] @errors << 'base_url must be provided' if self.params.txn_id.nil? raise ZipMoney::RequestError.new("Following error(s) occurred while making request, please resolve them to make the request: #{@errors}") if @errors.any? end |