Class: Rubyplat::Responses::Response
- Inherits:
-
Object
- Object
- Rubyplat::Responses::Response
- Extended by:
- Utils::Parser
- Defined in:
- lib/rubyplat/responses/response.rb
Direct Known Subclasses
CheckBalanceResponse, PaymentPermissionResponse, PaymentResponse, PaymentStatusResponse, RefillInfoResponse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Response
constructor
A new instance of Response.
Methods included from Utils::Parser
Constructor Details
#initialize(params = {}) ⇒ Response
Returns a new instance of Response.
11 12 13 14 15 16 17 18 |
# File 'lib/rubyplat/responses/response.rb', line 11 def initialize(params = {}) @date = DateTime.parse(params.delete(:date)) if params[:date] params.each do |k,v| instance_variable_set("@#{k}", v) self.class.class_eval { attr_reader k } end end |
Class Method Details
.from_response_string(response) ⇒ Object
6 7 8 |
# File 'lib/rubyplat/responses/response.rb', line 6 def self.from_response_string(response) new(parse(response)) end |