Class: Sms

Inherits:
Object
  • Object
show all
Defined in:
lib/smster/sms.rb

Direct Known Subclasses

SmsLayer

Defined Under Namespace

Classes: Clickatell, Nexmo, SmsUslugi, Smsru

Constant Summary collapse

STATUSES =

Codes

{ created: 0, sent: 1, delivered: 2, failed: 3 }

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Sms

Returns a new instance of Sms.



14
15
16
17
18
19
20
# File 'lib/smster/sms.rb', line 14

def initialize(attrs = {})
  attrs.each do |name, value|
    send("#{name}=", value)
  end

  @status = STATUSES[:created]
end

Instance Attribute Details

#api_message_idObject

Returns the value of attribute api_message_id.



2
3
4
# File 'lib/smster/sms.rb', line 2

def api_message_id
  @api_message_id
end

#balanceObject

Returns the value of attribute balance.



2
3
4
# File 'lib/smster/sms.rb', line 2

def balance
  @balance
end

#costObject

Returns the value of attribute cost.



2
3
4
# File 'lib/smster/sms.rb', line 2

def cost
  @cost
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/smster/sms.rb', line 2

def name
  @name
end

#statusObject

Returns the value of attribute status.



2
3
4
# File 'lib/smster/sms.rb', line 2

def status
  @status
end

#status_messageObject

Returns the value of attribute status_message.



2
3
4
# File 'lib/smster/sms.rb', line 2

def status_message
  @status_message
end

#textObject

Returns the value of attribute text.



2
3
4
# File 'lib/smster/sms.rb', line 2

def text
  @text
end

#toObject

Returns the value of attribute to.



2
3
4
# File 'lib/smster/sms.rb', line 2

def to
  @to
end

#typeObject

Returns the value of attribute type.



2
3
4
# File 'lib/smster/sms.rb', line 2

def type
  @type
end

Class Method Details

.send_sms(attrs = {}) ⇒ Object

Etc.



10
11
12
# File 'lib/smster/sms.rb', line 10

def self.send_sms(attrs = {})
  new(attrs).send_sms
end