Class: Moceansdk::Modules::Command::McObject::SendSMS

Inherits:
AbstractMc
  • Object
show all
Defined in:
lib/moceansdk/modules/command/mc_object/send_sms.rb

Instance Method Summary collapse

Methods inherited from AbstractMc

#get_request_data, #initialize

Constructor Details

This class inherits a constructor from Moceansdk::Modules::Command::McObject::AbstractMc

Instance Method Details

#actionObject



7
8
9
# File 'lib/moceansdk/modules/command/mc_object/send_sms.rb', line 7

def action
  'send-sms'
end

#content(text) ⇒ Object



29
30
31
32
33
34
# File 'lib/moceansdk/modules/command/mc_object/send_sms.rb', line 29

def content(text)
  @params[:'content'] = {}
  @params[:'content'][:'text'] = text
  @params[:'content'][:'type'] = 'text'
  return self
end

#from(from, contact_type = 'phone_num') ⇒ Object



15
16
17
18
19
20
# File 'lib/moceansdk/modules/command/mc_object/send_sms.rb', line 15

def from(from, contact_type = 'phone_num')
  @params[:'from'] = {}
  @params[:'from'][:'id'] = from
  @params[:'from'][:'type'] = contact_type
  return self
end

#required_keyObject



11
12
13
# File 'lib/moceansdk/modules/command/mc_object/send_sms.rb', line 11

def required_key
  ['from','to','content']
end

#to(to, contact_type = "phone_num") ⇒ Object



22
23
24
25
26
27
# File 'lib/moceansdk/modules/command/mc_object/send_sms.rb', line 22

def to(to, contact_type = "phone_num")
  @params[:'to'] = {}
  @params[:'to'][:'id'] = to
  @params[:'to'][:'type'] = contact_type
  return self
end