Class: SmsAero2::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/sms_aero2/operation.rb

Direct Known Subclasses

HlrOperation

Constant Summary collapse

BASE_URL =
'https://gate.smsaero.ru/v2/'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

#paramsObject (readonly)

Returns the value of attribute params.



4
5
6
# File 'lib/sms_aero2/operation.rb', line 4

def params
  @params
end

#requestObject (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

#callObject



12
13
14
# File 'lib/sms_aero2/operation.rb', line 12

def call
  result_class.new(request.call(url, **params))
end