Class: SmsAero2::Operation
- Inherits:
-
Object
- Object
- SmsAero2::Operation
- Defined in:
- lib/sms_aero2/operation.rb
Direct Known Subclasses
Constant Summary collapse
- BASE_URL =
'https://gate.smsaero.ru/v2/'.freeze
Instance Attribute Summary collapse
-
#action_path ⇒ Object
readonly
Returns the value of attribute action_path.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(request, action_path = '', **params) ⇒ Operation
constructor
A new instance of Operation.
Constructor Details
#initialize(request, action_path = '', **params) ⇒ Operation
Returns a new instance of Operation.
6 7 8 9 10 |
# File 'lib/sms_aero2/operation.rb', line 6 def initialize(request, action_path = '', **params) @request = request @action_path = action_path @params = params end |
Instance Attribute Details
#action_path ⇒ Object (readonly)
Returns the value of attribute action_path.
4 5 6 |
# File 'lib/sms_aero2/operation.rb', line 4 def action_path @action_path end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/sms_aero2/operation.rb', line 4 def params @params end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/sms_aero2/operation.rb', line 4 def request @request end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'lib/sms_aero2/operation.rb', line 12 def call result_class.new(request.call(url, **params)) end |