Class: Dude::ProjectManagement::Jira::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/dude/project_management/jira/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



25
26
27
28
29
30
# File 'lib/dude/project_management/jira/client.rb', line 25

def initialize
  @client = JIRA::Client.new(options)
  @project = client.Project.find(Dude::SETTINGS.dig(:jira, :project, :key))
rescue StandardError
  nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



36
37
38
# File 'lib/dude/project_management/jira/client.rb', line 36

def method_missing(method, *args, &block)
  client.send(method, *args, &block)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



13
14
15
# File 'lib/dude/project_management/jira/client.rb', line 13

def client
  @client
end

#projectObject (readonly)

Returns the value of attribute project.



13
14
15
# File 'lib/dude/project_management/jira/client.rb', line 13

def project
  @project
end

Instance Method Details

#fetch_current_task(id) ⇒ Object



44
45
46
# File 'lib/dude/project_management/jira/client.rb', line 44

def fetch_current_task(id)
  FetchCurrentTask.new(client, id: id).call
end

#fetch_current_tasksObject



40
41
42
# File 'lib/dude/project_management/jira/client.rb', line 40

def fetch_current_tasks
  FetchCurrentTasks.new(client).call
end

#get_task_name_by_id(id) ⇒ Object



52
53
54
# File 'lib/dude/project_management/jira/client.rb', line 52

def get_task_name_by_id(id)
  GetTaskNameById.new(client, id: id).call
end

#health_checkObject



56
57
58
59
60
# File 'lib/dude/project_management/jira/client.rb', line 56

def health_check
  @project && true
rescue StandardError
  false
end

#move_task_to_list(id, list) ⇒ Object



48
49
50
# File 'lib/dude/project_management/jira/client.rb', line 48

def move_task_to_list(id, list)
  MoveTaskToList.new(client, id: id, list_name: list).call
end

#optionsObject



15
16
17
18
19
20
21
22
23
# File 'lib/dude/project_management/jira/client.rb', line 15

def options
  {
    username: Dude::SETTINGS.dig(:jira, :email),
    password: Dude::SETTINGS.dig(:jira, :token),
    site: Dude::SETTINGS.dig(:jira, :project, :url),
    context_path: '',
    auth_type: :basic
  }
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/dude/project_management/jira/client.rb', line 32

def respond_to_missing?(method_name, include_private = false)
  client.respond_to_missing?(method_name, include_private)
end