Class: EventbriteSDK::Event

Inherits:
Resource show all
Defined in:
lib/eventbrite_sdk/event.rb

Constant Summary collapse

ERROR_CANNOT_UNPUBLISH =
'CANNOT_UNPUBLISH'.freeze
ERROR_ALREADY_PUBLISHED_OR_DELETED =
'ALREADY_PUBLISHED_OR_DELETED'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

build, define_api_actions, #delete, #initialize, #inspect, #new?, #read_attribute_for_serialization, #refresh!, #save, #to_json

Methods included from Resource::Operations::Relationships

included

Methods included from Resource::Operations::Endpoint

included

Methods included from Resource::Operations::AttributeSchema

included

Constructor Details

This class inherits a constructor from EventbriteSDK::Resource

Class Method Details

.search(params) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/eventbrite_sdk/event.rb', line 51

def self.search(params)
  ResourceList.new(
    url_base: 'events/search',
    object_class: self,
    key: 'events',
    query: params
  )
end

Instance Method Details

#list!Object



60
61
62
63
64
65
# File 'lib/eventbrite_sdk/event.rb', line 60

def list!
  unless listed
    assign_attributes('listed' => true)
    save
  end
end

#unlist!Object



67
68
69
70
71
72
# File 'lib/eventbrite_sdk/event.rb', line 67

def unlist!
  if listed
    assign_attributes('listed' => false)
    save
  end
end