module TripSpark
A Connection
adapter using HTTParty as the network transport
Constants
- VERSION
Public Class Methods
configuration()
click to toggle source
The current client configuration
# File lib/tripspark_api.rb, line 18 def configuration @configuration ||= Configuration.new end
configure(validate: true) { |configuration| ... }
click to toggle source
Allow users to set configuration options via a block. By default, the configuration will be validated after the block returns. This will raise an exception if any required configurations are not provided. This behavior can be skipped by passing `validate: false` as a parameter.
# File lib/tripspark_api.rb, line 26 def configure validate: true yield configuration configuration.validate! if validate configuration end
new()
click to toggle source
Alias for `TripSpark::Client.new`
# File lib/tripspark_api.rb, line 13 def new Client.new end
new(args={})
click to toggle source
Initialize a model instance with any given attributes assigned
# File lib/tripspark_api/models.rb, line 60 def initialize args={} assign(args) end
Public Instance Methods
==(o)
click to toggle source
Assume that two Model
objects are the same if their primary attributes have the same value
# File lib/tripspark_api/models.rb, line 79 def == o identifier == o.identifier end
assign(args={})
click to toggle source
Mass assign a group of attributes. Attribute names will be automatically be converted to snake_case for consistency.
# File lib/tripspark_api/models.rb, line 66 def assign args={} args.each do |name, value| public_send("#{name.underscore}=", value) end end
identifier()
click to toggle source
The value of the primary attribute on this model
# File lib/tripspark_api/models.rb, line 73 def identifier send(self.class.identifier) end