Class: Todoist::Result
- Inherits:
-
Object
- Object
- Todoist::Result
- Includes:
- Enumerable
- Defined in:
- lib/todoist/query.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(result) ⇒ Result
constructor
A new instance of Result.
- #size ⇒ Object
Constructor Details
#initialize(result) ⇒ Result
Returns a new instance of Result.
7 8 9 10 |
# File 'lib/todoist/query.rb', line 7 def initialize(result) @query = result['query'] @data = result['data'] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/todoist/query.rb', line 5 def data @data end |
Instance Method Details
#each(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/todoist/query.rb', line 12 def each(&block) data.each do |object| block.call(Todoist::Item.new(object)) end end |
#size ⇒ Object
18 19 20 |
# File 'lib/todoist/query.rb', line 18 def size data.size end |