Class: Dude::ProjectManagement::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



11
12
13
14
15
16
# File 'lib/dude/project_management/client.rb', line 11

def initialize
  tool = Dude::SETTINGS[:project_management_tool]
  return unless LIST_OF_AVAILABLE_PROJECT_MANAGEMENT_TOOLS.include? tool

  @client = setup_client(tool)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



22
23
24
# File 'lib/dude/project_management/client.rb', line 22

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

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



9
10
11
# File 'lib/dude/project_management/client.rb', line 9

def client
  @client
end

Instance Method Details

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/dude/project_management/client.rb', line 18

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

#setup_client(tool) ⇒ Object



26
27
28
# File 'lib/dude/project_management/client.rb', line 26

def setup_client(tool)
  Object.const_get("Dude::ProjectManagement::#{tool.capitalize}::Client").new
end