Class: Rodzilla::WebService

Inherits:
Object
  • Object
show all
Defined in:
lib/rodzilla/web_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, username, password, format = :json, options = {}) ⇒ WebService

base_url - The String full uri of the Bugzilla api server username - The String containing the bugzilla authorized users username password - The String containing the bugzilla authorized users password format - The request/response format which defaults to :json



10
11
12
13
14
15
16
# File 'lib/rodzilla/web_service.rb', line 10

def initialize(base_url, username, password, format=:json, options={})
  @base_url     = base_url
  @username     = username
  @password     = password
  @format       = format
  @options      = options || {}
end

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



4
5
6
# File 'lib/rodzilla/web_service.rb', line 4

def base_url
  @base_url
end

#formatObject

Returns the value of attribute format.



4
5
6
# File 'lib/rodzilla/web_service.rb', line 4

def format
  @format
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/rodzilla/web_service.rb', line 4

def options
  @options
end

#resourceObject

Returns the value of attribute resource.



4
5
6
# File 'lib/rodzilla/web_service.rb', line 4

def resource
  @resource
end

Instance Method Details

#bugsObject

Provide a shortcut for instantiation Bug objects

Returns an instance of the Rodzilla::Resource::Bug class



21
22
23
# File 'lib/rodzilla/web_service.rb', line 21

def bugs
  bugzilla_resource('Bug')
end

#bugzillaObject

Provide a shortcut for instantiation Bugzilla objects

Returns an instance of the Rodzilla::Resource::Bugzilla class



28
29
30
# File 'lib/rodzilla/web_service.rb', line 28

def bugzilla
  bugzilla_resource('Bugzilla')
end

#classificationsObject

Provide a shortcut for instantiation Classification objects

Returns an instance of the Rodzilla::Resource::Classification class



35
36
37
# File 'lib/rodzilla/web_service.rb', line 35

def classifications
  bugzilla_resource('Classification')
end

#groupsObject

Provide a shortcut for instantiation Group objects

Returns an instance of the Rodzilla::Resource::Group class



42
43
44
# File 'lib/rodzilla/web_service.rb', line 42

def groups
  bugzilla_resource('Group')
end

#productsObject

Provide a shortcut for instantiation Product objects

Returns an instance of the Rodzilla::Resource::Product class



49
50
51
# File 'lib/rodzilla/web_service.rb', line 49

def products
  bugzilla_resource('Product')
end

#usersObject

Provide a shortcut for instantiation User objects

Returns an instance of the Rodzilla::Resource::User class



56
57
58
# File 'lib/rodzilla/web_service.rb', line 56

def users
  bugzilla_resource('User')
end