Class: RMC::Tasks
- Inherits:
-
Object
- Object
- RMC::Tasks
- Defined in:
- lib/rmc/tasks.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(connection) ⇒ Tasks
constructor
A new instance of Tasks.
- #list_tasks(query = nil) ⇒ Object
Constructor Details
permalink #initialize(connection) ⇒ Tasks
Returns a new instance of Tasks.
7 8 9 |
# File 'lib/rmc/tasks.rb', line 7 def initialize(connection) @connection = connection end |
Instance Attribute Details
permalink #connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'lib/rmc/tasks.rb', line 5 def connection @connection end |
Instance Method Details
permalink #list_tasks(query = nil) ⇒ Object
[View source]
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rmc/tasks.rb', line 11 def list_tasks(query=nil) @connection.version = 2 response = @connection.request( url: "/tasks#{query ? "?query=\"#{query}\"" : ''}" ) tasks = [] response['tasks'].each do |_data| tasks << RMC::Item::Task.new(@connection, _data) end tasks end |