Class: Tito::Admin::Client
- Inherits:
-
Object
- Object
- Tito::Admin::Client
- Defined in:
- lib/tito/admin/client.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #activities(event: self.event) ⇒ Object
- #archived_events ⇒ Object
- #checkin_lists(event: self.event) ⇒ Object
- #discount_codes(event: self.event) ⇒ Object
-
#events ⇒ Object
– Account-scoped resources –.
-
#initialize(token: nil, account: nil, event: nil) ⇒ Client
constructor
A new instance of Client.
- #interested_users(event: self.event) ⇒ Object
- #opt_ins(event: self.event) ⇒ Object
- #past_events ⇒ Object
- #questions(event: self.event) ⇒ Object
- #registrations(event: self.event) ⇒ Object
- #releases(event: self.event) ⇒ Object
- #rsvp_lists(event: self.event) ⇒ Object
-
#tickets(event: self.event) ⇒ Object
– Event-scoped resources –.
- #venues(event: self.event) ⇒ Object
- #waitlisted_people(event: self.event) ⇒ Object
- #webhook_endpoints(event: self.event) ⇒ Object
Constructor Details
#initialize(token: nil, account: nil, event: nil) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/tito/admin/client.rb', line 6 def initialize(token: nil, account: nil, event: nil) @token = token || Tito.configuration.token @account = account || Tito.configuration.account @event = event raise Tito::Errors::ConfigurationError, "token is required" unless @token raise Tito::Errors::ConfigurationError, "account is required" unless @account @connection = Tito::Connection.new(token: @token) end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
4 5 6 |
# File 'lib/tito/admin/client.rb', line 4 def account @account end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/tito/admin/client.rb', line 4 def connection @connection end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
4 5 6 |
# File 'lib/tito/admin/client.rb', line 4 def event @event end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/tito/admin/client.rb', line 4 def token @token end |
Instance Method Details
#activities(event: self.event) ⇒ Object
45 46 47 |
# File 'lib/tito/admin/client.rb', line 45 def activities(event: self.event) collection_for(Resources::Activity, event: event) end |
#archived_events ⇒ Object
27 28 29 |
# File 'lib/tito/admin/client.rb', line 27 def archived_events collection_for(Resources::Event, path_suffix: "/archived") end |
#checkin_lists(event: self.event) ⇒ Object
57 58 59 |
# File 'lib/tito/admin/client.rb', line 57 def checkin_lists(event: self.event) collection_for(Resources::CheckinList, event: event) end |
#discount_codes(event: self.event) ⇒ Object
53 54 55 |
# File 'lib/tito/admin/client.rb', line 53 def discount_codes(event: self.event) collection_for(Resources::DiscountCode, event: event) end |
#events ⇒ Object
– Account-scoped resources –
19 20 21 |
# File 'lib/tito/admin/client.rb', line 19 def events collection_for(Resources::Event) end |
#interested_users(event: self.event) ⇒ Object
65 66 67 |
# File 'lib/tito/admin/client.rb', line 65 def interested_users(event: self.event) collection_for(Resources::InterestedUser, event: event) end |
#opt_ins(event: self.event) ⇒ Object
61 62 63 |
# File 'lib/tito/admin/client.rb', line 61 def opt_ins(event: self.event) collection_for(Resources::OptIn, event: event) end |
#past_events ⇒ Object
23 24 25 |
# File 'lib/tito/admin/client.rb', line 23 def past_events collection_for(Resources::Event, path_suffix: "/past") end |
#questions(event: self.event) ⇒ Object
49 50 51 |
# File 'lib/tito/admin/client.rb', line 49 def questions(event: self.event) collection_for(Resources::Question, event: event) end |
#registrations(event: self.event) ⇒ Object
41 42 43 |
# File 'lib/tito/admin/client.rb', line 41 def registrations(event: self.event) collection_for(Resources::Registration, event: event) end |
#releases(event: self.event) ⇒ Object
37 38 39 |
# File 'lib/tito/admin/client.rb', line 37 def releases(event: self.event) collection_for(Resources::Release, event: event) end |
#rsvp_lists(event: self.event) ⇒ Object
69 70 71 |
# File 'lib/tito/admin/client.rb', line 69 def rsvp_lists(event: self.event) collection_for(Resources::RsvpList, event: event) end |
#tickets(event: self.event) ⇒ Object
– Event-scoped resources –
33 34 35 |
# File 'lib/tito/admin/client.rb', line 33 def tickets(event: self.event) collection_for(Resources::Ticket, event: event) end |
#venues(event: self.event) ⇒ Object
77 78 79 |
# File 'lib/tito/admin/client.rb', line 77 def venues(event: self.event) collection_for(Resources::Venue, event: event) end |
#waitlisted_people(event: self.event) ⇒ Object
73 74 75 |
# File 'lib/tito/admin/client.rb', line 73 def waitlisted_people(event: self.event) collection_for(Resources::WaitlistedPerson, event: event) end |
#webhook_endpoints(event: self.event) ⇒ Object
81 82 83 |
# File 'lib/tito/admin/client.rb', line 81 def webhook_endpoints(event: self.event) collection_for(Resources::WebhookEndpoint, event: event) end |