Class: K2ConnectRuby::K2Entity::K2Entity
- Inherits:
-
Object
- Object
- K2ConnectRuby::K2Entity::K2Entity
- Includes:
- K2ConnectRuby::K2Utilities
- Defined in:
- lib/k2-connect-ruby/k2_entity/k2_entity.rb
Direct Known Subclasses
ExternalRecipient, K2Stk, PaymentLink, Reversal, SendMoney, TransferAccount
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#k2_response_body ⇒ Object
readonly
Returns the value of attribute k2_response_body.
-
#location_url ⇒ Object
readonly
Returns the value of attribute location_url.
-
#query_hash ⇒ Object
readonly
Returns the value of attribute query_hash.
Instance Method Summary collapse
-
#initialize(access_token) ⇒ K2Entity
constructor
Initialize with access token from Subscriber Class.
- #query(endpoint) ⇒ Object
-
#query_resource(endpoint) ⇒ Object
Query Location URL.
-
#query_status(endpoint) ⇒ Object
Query/Check the status of a previously initiated request.
Constructor Details
#initialize(access_token) ⇒ K2Entity
Initialize with access token from Subscriber Class
13 14 15 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 13 def initialize(access_token) @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
7 8 9 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 7 def access_token @access_token end |
#k2_response_body ⇒ Object (readonly)
Returns the value of attribute k2_response_body.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 8 def k2_response_body @k2_response_body end |
#location_url ⇒ Object (readonly)
Returns the value of attribute location_url.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 8 def location_url @location_url end |
#query_hash ⇒ Object (readonly)
Returns the value of attribute query_hash.
8 9 10 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 8 def query_hash @query_hash end |
Instance Method Details
#query(endpoint) ⇒ Object
27 28 29 30 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 27 def query(endpoint) result = K2ConnectRuby::K2Services::SendK2ConnectGetRequestService.call(access_token, endpoint) @k2_response_body = result.data[:response_body] end |
#query_resource(endpoint) ⇒ Object
Query Location URL
23 24 25 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 23 def query_resource(endpoint) query(endpoint) end |
#query_status(endpoint) ⇒ Object
Query/Check the status of a previously initiated request
18 19 20 |
# File 'lib/k2-connect-ruby/k2_entity/k2_entity.rb', line 18 def query_status(endpoint) query(endpoint) end |