Class: BerlinBuehnen::ListResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/berlin_buehnen/list_response.rb

Constant Summary collapse

META =
"meta"
OBJECTS =
"objects"
NEXT =
"next"
PREVIOUS =
"previous"
OFFSET =
"offset"
LIMIT =
"limit"
TOTAL_COUNT =
"total_count"

Instance Attribute Summary

Attributes inherited from Response

#json_response

Instance Method Summary collapse

Methods inherited from Response

create, #initialize

Constructor Details

This class inherits a constructor from BerlinBuehnen::Response

Instance Method Details

#dataObject



13
14
15
# File 'lib/berlin_buehnen/list_response.rb', line 13

def data
  @data ||= @json_response[OBJECTS]
end

#limitObject



25
26
27
# File 'lib/berlin_buehnen/list_response.rb', line 25

def limit
  meta[LIMIT]
end

#next?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/berlin_buehnen/list_response.rb', line 17

def next?
  !meta[NEXT].nil?
end

#offsetObject



29
30
31
# File 'lib/berlin_buehnen/list_response.rb', line 29

def offset
  meta[OFFSET]
end

#previous?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/berlin_buehnen/list_response.rb', line 21

def previous?
  !meta[PREVIOUS].nil?
end

#total_countObject



33
34
35
# File 'lib/berlin_buehnen/list_response.rb', line 33

def total_count
  meta[TOTAL_COUNT]
end