Class: Skype::SMS

Inherits:
AbstractObject show all
Defined in:
lib/skype/sms.rb

Constant Summary collapse

OBJECT_NAME =
"SMS"

Instance Attribute Summary

Attributes included from AbstractObject::Get

#property2callback, #property2symbol

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractObject

inherited, #initialize, new, notified, #to_s

Methods included from AbstractObject::Notify

#delNotify, #notified, #notify, #setNotify

Methods included from AbstractObject::Get

#def_parser, #notice

Methods included from AbstractObject::Invokers

#invoke_alter, #invoke_echo, #invoke_get, #invoke_one, #invoke_set

Constructor Details

This class inherits a constructor from Skype::AbstractObject

Class Method Details

.create(target, type = "OUTGOING") ⇒ Object



5
6
7
8
9
10
# File 'lib/skype/sms.rb', line 5

def create target, type="OUTGOING"
  res = Skype.invoke "CREATE SMS #{type} #{target}"
  res =~ /^SMS (\d+) STATUS (.+)$/
  id, status = $1, $2
  return id, status
end

.createConfirmationCodeRequest(target) ⇒ Object Also known as: create_confirmation_code_request



12
13
14
# File 'lib/skype/sms.rb', line 12

def createConfirmationCodeRequest target
  create target, 'CONFIRMATION_CODE_REQUEST'
end

.delete(id) ⇒ Object



17
18
19
# File 'lib/skype/sms.rb', line 17

def delete id
  Skype.invoke_echo "DELETE SMS #{id}"
end

Instance Method Details

#deleteObject



89
# File 'lib/skype/sms.rb', line 89

def delete() invoke_echo "DLETE SMS #{@id}" end

#get_bodyObject Also known as: getBody



22
# File 'lib/skype/sms.rb', line 22

def get_body() invoke_get("BODY") end

#get_chunk(noOfChunks) ⇒ Object Also known as: getChunk

send?



78
79
80
81
# File 'lib/skype/sms.rb', line 78

def get_chunk noOfChunks
  res = invoke "CHUNK #{noOfChunks}"
  return noOfChunks, res
end

#get_failure_reasonObject Also known as: getFailureReason



34
# File 'lib/skype/sms.rb', line 34

def get_failure_reason() invoke_get("FAILUREREASON") end

#get_is_failed_unseen?Boolean Also known as: getIsFailedUnseen?

Returns:

  • (Boolean)


38
# File 'lib/skype/sms.rb', line 38

def get_is_failed_unseen?() invoke_get("IS_FAILED_UNSEEN") end

#get_priceObject Also known as: getPrice



46
# File 'lib/skype/sms.rb', line 46

def get_price() parse :price, invoke_get("PRICE") end

#get_price_currencyObject Also known as: getPriceCurrency



54
# File 'lib/skype/sms.rb', line 54

def get_price_currency() invoke_get("PRICE_CURRENCY") end

#get_price_precisionObject Also known as: getPricePrecision



50
# File 'lib/skype/sms.rb', line 50

def get_price_precision() parse :price_precision, invoke_get("PRICE_PRECISION") end

#get_reply_to_numberObject Also known as: getReplyToNumber



58
# File 'lib/skype/sms.rb', line 58

def get_reply_to_number() invoke_get("REPLY_TO_NUMBER") end

#get_statusObject Also known as: getStatus



30
# File 'lib/skype/sms.rb', line 30

def get_status() invoke_get("STATUS") end

#get_target_numbersObject Also known as: getTargetNumbers



62
# File 'lib/skype/sms.rb', line 62

def get_target_numbers() parse :target_numbers, invoke_get("TARGET_NUMBERS") end

#get_target_statusesObject Also known as: getTargetStatuses



66
# File 'lib/skype/sms.rb', line 66

def get_target_statuses() parse :target_statuses, invoke_get("TARGET_STATUSES") end

#get_timestampObject Also known as: getTimestamp



42
# File 'lib/skype/sms.rb', line 42

def get_timestamp() parse :timestamp, invoke_get("TIMESTAMP") end

#get_typeObject Also known as: getType



26
# File 'lib/skype/sms.rb', line 26

def get_type() invoke_get("TYPE") end

#sendObject



87
# File 'lib/skype/sms.rb', line 87

def send() invoke_alter "SEND" end

#set_body(text) ⇒ Object Also known as: setBody



84
# File 'lib/skype/sms.rb', line 84

def set_body(text) invoke_set "BODY", text end

#set_reply_to_number(pstn) ⇒ Object Also known as: setReplyToNumber



100
# File 'lib/skype/sms.rb', line 100

def set_reply_to_number(pstn) invoke_set "REPLY_TO_NUMBER", pstn end

#set_seenObject Also known as: setSeen



97
# File 'lib/skype/sms.rb', line 97

def set_seen() invoke_set "SEEN" end

#set_target_number(*nums) ⇒ Object Also known as: setTargetNumber



91
92
93
94
# File 'lib/skype/sms.rb', line 91

def set_target_number *nums
  nums = nums[0] if nums[0].class == Array
  invoke_set "TARGET_NUMBERS", nums.join(', ')
end