lib/api.rb in bobes-textmagic-0.2.2 vs lib/api.rb in bobes-textmagic-0.2.3
- old
+ new
@@ -37,11 +37,11 @@
response.extend(TextMagic::API::Response::Account)
end
# Executes a send command and returns a hash with message ids, sent text and
# number of parts if successful, otherwise it raises an Error.
- # The returned hash will be extended with custom reader method defined
+ # The returned hash will be extended with custom reader methods defined
# in Response module.
#
# This method accepts any positive number of phone numbers and an additional
# options hash.
#
@@ -62,16 +62,12 @@
# Using custom readers:
#
# response = api.send('Hi Vilma', '999314159265', '999271828182')
# response.message_ids
# # => ['141421', '173205']
- # response.message_id_hash
- # # => { '999314159265' => '141421', '999271828182' => '173205' }
- # response.message_id
+ # response['999314159265']
# # => '141421'
- # response.message_id('999271828182')
- # # => '173205'
# response.parts_count
# # => 1
def send(text, *args)
raise Error.new(1, 'Message text is empty') if text.nil? || text.blank?
options = args.last.is_a?(Hash) ? args.pop : {}
@@ -92,11 +88,11 @@
end
# Executes a message_status command and returns a hash with states of
# messages for specified ids if successful, otherwise it raises a
# TextMagic::API::Error.
- # The returned hash will be extended with custom reader method defined
+ # The returned hash will be extended with custom reader methods defined
# in Response module.
#
# This method accepts any positive number of ids specified as an array
# or as a list of arguments
#
@@ -125,11 +121,11 @@
single ? response[ids.first] : response
end
# Executes a receive command and returns a hash with unread messages
# if successful, otherwise it raises an Error.
- # The returned hash will be extended with custom reader method defined
+ # The returned hash will be extended with custom reader methods defined
# in Response module.
#
# This method accepts an optional +last_retrieved_id+ value.
#
# Example usage:
@@ -152,10 +148,10 @@
response.extend(TextMagic::API::Response::Receive)
end
# Executes a delete_reply command and returns a hash with a list of deleted
# message ids if successful, otherwise it raises an Error.
- # The returned hash will be extended with custom reader method defined
+ # The returned hash will be extended with custom reader methods defined
# in Response module.
#
# This method accepts any positive number of ids specified as an array
# or as a list of arguments.
#