lib/twilio-ruby/rest/preview/wireless/command.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/preview/wireless/command.rb in twilio-ruby-5.0.0.rc10
- old
+ new
@@ -10,11 +10,10 @@
class Wireless < Version
class CommandList < ListResource
##
# Initialize the CommandList
# @param [Version] version Version that contains the resource
-
# @return [CommandList] CommandList
def initialize(version)
super(version)
# Path Solution
@@ -33,11 +32,10 @@
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when not set will use
# the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the
# limit with the most efficient page size, i.e. min(limit, 1000)
-
# @return [Array] Array of up to limit results
def list(device: nil, status: nil, direction: nil, limit: nil, page_size: nil)
self.stream(
device: device,
status: status,
@@ -58,11 +56,10 @@
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when not set will use
# the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the
# limit with the most efficient page size, i.e. min(limit, 1000)
-
# @return [Enumerable] Enumerable that will yield up to limit results
def stream(device: nil, status: nil, direction: nil, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
page = self.page(
@@ -107,11 +104,10 @@
# @param [String] status The status
# @param [String] direction The direction
# @param [String] page_token PageToken provided by the API
# @param [Integer] page_number Page Number, this value is simply for client state
# @param [Integer] page_size Number of records to return, defaults to 50
-
# @return [Page] Page of CommandInstance
def page(device: nil, status: nil, direction: nil, page_token: nil, page_number: nil, page_size: nil)
params = {
'Device' => device,
'Status' => status,
@@ -133,11 +129,10 @@
# Request is executed immediately.
# @param [String] device The device
# @param [String] command The command
# @param [String] callback_method The callback_method
# @param [String] callback_url The callback_url
-
# @return [CommandInstance] Newly created CommandInstance
def create(device: nil, command: nil, callback_method: nil, callback_url: nil)
data = {
'Device' => device,
'Command' => command,
@@ -168,11 +163,10 @@
##
# Initialize the CommandPage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
-
# @return [CommandPage] CommandPage
def initialize(version, response, solution)
super(version, response)
# Path Solution
@@ -180,11 +174,10 @@
end
##
# Build an instance of CommandInstance
# @param [Hash] payload Payload response from the API
-
# @return [CommandInstance] CommandInstance
def get_instance(payload)
return CommandInstance.new(
@version,
payload,
@@ -201,11 +194,10 @@
class CommandContext < InstanceContext
##
# Initialize the CommandContext
# @param [Version] version Version that contains the resource
# @param [String] sid The sid
-
# @return [CommandContext] CommandContext
def initialize(version, sid)
super(version)
# Path Solution
@@ -228,11 +220,11 @@
)
return CommandInstance.new(
@version,
payload,
- sid: @solution['sid'],
+ sid: @solution[:sid],
)
end
##
# Provide a user friendly representation
@@ -246,11 +238,10 @@
##
# Initialize the CommandInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] sid The sid
-
# @return [CommandInstance] CommandInstance
def initialize(version, payload, sid: nil)
super(version)
# Marshaled Properties
@@ -275,11 +266,10 @@
##
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @param [Version] version Version that contains the resource
-
# @return [CommandContext] CommandContext for this CommandInstance
def context
unless @instance_context
@instance_context = CommandContext.new(
@version,
@@ -327,17 +317,17 @@
##
# Fetch a CommandInstance
# @return [CommandInstance] Fetched CommandInstance
def fetch
- @context.fetch()
+ context.fetch
end
##
# Provide a user friendly representation
def to_s
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Preview.Wireless.CommandInstance #{context}>"
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Preview.Wireless.CommandInstance #{values}>"
end
end
end
end
end
\ No newline at end of file