Class: GProv::Connection

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/gprov/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, token, options = {}) ⇒ Connection

Returns a new instance of Connection.



29
30
31
32
33
34
35
36
37
# File 'lib/gprov/connection.rb', line 29

def initialize(domain, token, options = {})
  @domain = domain
  @token  = token
  @options = options

  if @options[:debug]
    self.class.debug_output $stderr
  end
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



28
29
30
# File 'lib/gprov/connection.rb', line 28

def domain
  @domain
end

Instance Method Details

#default_headersObject



39
40
41
42
43
44
# File 'lib/gprov/connection.rb', line 39

def default_headers
  {:headers => {
    'Authorization' => "GoogleLogin auth=#{@token}",
    'Content-Type'  => 'application/atom+xml',
  }}
end