Class: Centaman::Service::BookingType

Inherits:
Centaman::Service show all
Includes:
JsonWrapper
Defined in:
lib/centaman/service/booking_type.rb

Constant Summary

Constants inherited from Centaman::Service

DEFAULT_TIMEOUT_TIME

Constants inherited from Wrapper

Wrapper::FIXIE

Instance Attribute Summary

Attributes inherited from Wrapper

#api_password, #api_token, #api_username

Class Method Summary collapse

Instance Method Summary collapse

Methods included from JsonWrapper

#additional_hash_to_serialize_after_response, #build_object, #build_objects, #objects

Methods inherited from Centaman::Service

#after_init, #after_post, #fetch_all, #payload, #payload_key, #post, #wrap_request_in_case_of_timeout

Methods inherited from Wrapper

#after_init, #generate_token, #headers, #initialize, #options, #options_hash

Constructor Details

This class inherits a constructor from Centaman::Wrapper

Class Method Details

.find(booking_type_id, date) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/centaman/service/booking_type.rb', line 19

def self.find(booking_type_id, date)
  obj = new(
    start_date: date,
    end_date: date
  )
  obj.objects.detect {|obj| obj.booking_type_id == booking_type_id }
end

Instance Method Details

#all_booking_typeObject



12
13
14
15
16
17
# File 'lib/centaman/service/booking_type.rb', line 12

def all_booking_type
  object_class.new({
    'BookingTypeId' => 0,
    'BookingDescription' => 'All Booking Types'
  })
end

#endpointObject



4
5
6
# File 'lib/centaman/service/booking_type.rb', line 4

def endpoint
  '/ticket_services/TimedTicket'
end

#object_classObject



8
9
10
# File 'lib/centaman/service/booking_type.rb', line 8

def object_class
  Centaman::Object::BookingType
end