Class: EventbriteSDK::BlankResourceList

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/eventbrite_sdk/blank_resource_list.rb

Overview

An Empty resource listing, returned on ORM calls from new resources

Instance Method Summary collapse

Constructor Details

#initialize(key: nil) ⇒ BlankResourceList

Returns a new instance of BlankResourceList.



9
10
11
12
# File 'lib/eventbrite_sdk/blank_resource_list.rb', line 9

def initialize(key: nil)
  @key = key
  @objects = []
end

Instance Method Details

#concat(other) ⇒ Object



22
23
24
# File 'lib/eventbrite_sdk/blank_resource_list.rb', line 22

def concat(other)
  other.concat(to_ary)
end

#object_countObject

Blank lists need to respond to the pagination helpers.



39
40
41
# File 'lib/eventbrite_sdk/blank_resource_list.rb', line 39

def object_count
  0
end

#page(_num) ⇒ Object



26
27
28
# File 'lib/eventbrite_sdk/blank_resource_list.rb', line 26

def page(_num)
  self
end

#to_json(opts = {}) ⇒ Object



34
35
36
# File 'lib/eventbrite_sdk/blank_resource_list.rb', line 34

def to_json(opts = {})
  { @key => [] }.to_json(opts)
end

#with_expansion(*_args) ⇒ Object



30
31
32
# File 'lib/eventbrite_sdk/blank_resource_list.rb', line 30

def with_expansion(*_args)
  self
end