Class: CDP::Timeline::Response
- Inherits:
-
Object
- Object
- CDP::Timeline::Response
- Defined in:
- lib/cdp/timeline/response.rb
Defined Under Namespace
Classes: Paging
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#paging ⇒ Object
readonly
Returns the value of attribute paging.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(success: true, items: [], paging: nil, error: nil) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(success: true, items: [], paging: nil, error: nil) ⇒ Response
Returns a new instance of Response.
19 20 21 22 23 24 25 26 |
# File 'lib/cdp/timeline/response.rb', line 19 def initialize(success: true, items: [], paging: nil, error: nil) raise ArgumentError, "Invalid paging object." if paging && !paging.is_a?(Paging) @success = success @items = items @paging = paging || Paging.new @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
17 18 19 |
# File 'lib/cdp/timeline/response.rb', line 17 def error @error end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
17 18 19 |
# File 'lib/cdp/timeline/response.rb', line 17 def items @items end |
#paging ⇒ Object (readonly)
Returns the value of attribute paging.
17 18 19 |
# File 'lib/cdp/timeline/response.rb', line 17 def paging @paging end |
Instance Method Details
#error? ⇒ Boolean
32 33 34 |
# File 'lib/cdp/timeline/response.rb', line 32 def error? !success? end |
#success? ⇒ Boolean
28 29 30 |
# File 'lib/cdp/timeline/response.rb', line 28 def success? !!@success end |