Class: Arbor::Client

Inherits:
Object
  • Object
show all
Includes:
API, Utils
Defined in:
lib/arbor/client.rb

Constant Summary

Constants included from Utils

Utils::INFLECTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#attempt, #get_resource_name, #left_pad, #parse_resource_name, #validate

Methods included from API

#changelog, #query, #retrieve

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client.

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
# File 'lib/arbor/client.rb', line 12

def initialize(*args)
  @settings = args.last.is_a?(Hash) ? args.pop : {}
  raise ArgumentError, "must supply a subdomain, username and password" if args.length < 3
  subdomain, @username, @password = args
  @host = "https://#{subdomain}.uk.arbor.sc"
  @highest_revision = 0
end

Instance Attribute Details

#highest_revisionObject

Returns the value of attribute highest_revision.



10
11
12
# File 'lib/arbor/client.rb', line 10

def highest_revision
  @highest_revision
end

#hostObject

Returns the value of attribute host.



10
11
12
# File 'lib/arbor/client.rb', line 10

def host
  @host
end

#passwordObject

Returns the value of attribute password.



10
11
12
# File 'lib/arbor/client.rb', line 10

def password
  @password
end

#settingsObject

Returns the value of attribute settings.



10
11
12
# File 'lib/arbor/client.rb', line 10

def settings
  @settings
end

#usernameObject

Returns the value of attribute username.



10
11
12
# File 'lib/arbor/client.rb', line 10

def username
  @username
end