Class: LittleSMS::Component

Inherits:
Object
  • Object
show all
Defined in:
lib/little_sms/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component, api_user, api_key) ⇒ Component

Returns a new instance of Component.



14
15
16
17
18
# File 'lib/little_sms/component.rb', line 14

def initialize(component, api_user, api_key)
  @api_uri = URI.parse("https://littlesms.ru:443/api/")
  @api_user, @api_key = api_user, api_key
  @component = component # Component name. E.g. message or user.
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



20
21
22
# File 'lib/little_sms/component.rb', line 20

def method_missing(name, *args)
  request_api_method(name, args[0])
end

Instance Attribute Details

#componentObject (readonly)

Returns the value of attribute component.



12
13
14
# File 'lib/little_sms/component.rb', line 12

def component
  @component
end