Class: JIRA::Resource::ApplicationLink

Inherits:
Base
  • Object
show all
Defined in:
lib/jira/resource/applinks.rb

Constant Summary collapse

REST_BASE_PATH =
'/rest/applinks/1.0'

Constants inherited from Base

Base::QUERY_PARAMS_FOR_SEARCH, Base::QUERY_PARAMS_FOR_SINGLE_FETCH

Instance Attribute Summary

Attributes inherited from Base

#attrs, #client, #deleted, #expanded

Class Method Summary collapse

Methods inherited from Base

belongs_to, belongs_to_relationships, build, collection_attributes_are_nested, #collection_path, #delete, #fetch, find, #has_errors?, has_many, has_one, #id, #initialize, key_attribute, #key_value, #method_missing, nested_collections, #new_record?, parse_json, #patched_url, #path_component, #respond_to?, #save, #save!, #set_attrs, #set_attrs_from_response, singular_path, #to_json, #to_s, #to_sym, #url

Constructor Details

This class inherits a constructor from JIRA::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class JIRA::Base

Class Method Details

.all(client, options = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/jira/resource/applinks.rb', line 24

def self.all(client, options = {})
  response = client.get(collection_path(client))
  json = parse_json(response.body)
  json = json['list']
  json.map do |attrs|
    self.new(client, {:attrs => attrs}.merge(options))
  end
end

.collection_path(client, prefix = '/') ⇒ Object



20
21
22
# File 'lib/jira/resource/applinks.rb', line 20

def self.collection_path(client, prefix = '/')
  self.full_url(client) + prefix + self.endpoint_name
end

.endpoint_nameObject



12
13
14
# File 'lib/jira/resource/applinks.rb', line 12

def self.endpoint_name
  'listApplicationlinks'
end

.full_url(client) ⇒ Object



16
17
18
# File 'lib/jira/resource/applinks.rb', line 16

def self.full_url(client)
  client.options[:context_path] + REST_BASE_PATH
end

.manifest(client) ⇒ Object



33
34
35
36
37
38
# File 'lib/jira/resource/applinks.rb', line 33

def self.manifest(client)
  url = self.full_url(client) + '/manifest'
  response = client.get(url)
  json = parse_json(response.body)
  JIRA::Base.new(client, {:attrs => json})
end