Class: FellowshipOneAPI::Base

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/f1api/activeresource/base.rb

Overview

The Base class should be inherited by all model classes as it provides the facilities that the class will need

Class Method Summary collapse

Class Method Details

.connect(client, refresh = false) ⇒ Object

Creates a new connection

Examples

Person.connect(FellowshipOneAPI::Client.new)

If the connection needs to be forcibly refreshed then you can pass true

Person.connect(FellowshipOneAPI::Client.new, true)


11
12
13
14
15
# File 'lib/f1api/activeresource/base.rb', line 11

def self.connect(client, refresh = false)
  if(refresh or @connection.nil?)
    @connection = Connection.new(client, client.consumer.site, format)
  end
end