Class: K2ConnectRuby::K2Entity::K2FinancialEntities::Polling::PollingRequest
- Inherits:
-
Object
- Object
- K2ConnectRuby::K2Entity::K2FinancialEntities::Polling::PollingRequest
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/k2-connect-ruby/k2_entity/polling/polling_request.rb
Instance Attribute Summary collapse
-
#callback_url ⇒ Object
Returns the value of attribute callback_url.
-
#from_time ⇒ Object
Returns the value of attribute from_time.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#scope_reference ⇒ Object
Returns the value of attribute scope_reference.
-
#to_time ⇒ Object
Returns the value of attribute to_time.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize(kwargs) ⇒ PollingRequest
constructor
A new instance of PollingRequest.
- #request_body ⇒ Object
- #till_scope? ⇒ Boolean
Constructor Details
#initialize(kwargs) ⇒ PollingRequest
Returns a new instance of PollingRequest.
19 20 21 22 23 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 19 def initialize(kwargs) kwargs.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#callback_url ⇒ Object
Returns the value of attribute callback_url.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 10 def callback_url @callback_url end |
#from_time ⇒ Object
Returns the value of attribute from_time.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 10 def from_time @from_time end |
#scope ⇒ Object
Returns the value of attribute scope.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 10 def scope @scope end |
#scope_reference ⇒ Object
Returns the value of attribute scope_reference.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 10 def scope_reference @scope_reference end |
#to_time ⇒ Object
Returns the value of attribute to_time.
10 11 12 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 10 def to_time @to_time end |
Instance Method Details
#endpoint ⇒ Object
25 26 27 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 25 def endpoint K2ConnectRuby::K2Utilities::Config::K2Config.endpoint("poll") end |
#request_body ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 29 def request_body { scope: scope, scope_reference: scope_reference, from_time: from_time, to_time: to_time, _links: { callback_url: callback_url, }, } end |
#till_scope? ⇒ Boolean
41 42 43 |
# File 'lib/k2-connect-ruby/k2_entity/polling/polling_request.rb', line 41 def till_scope? scope == "till" end |