Class: TM::ProviderHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/tm/provider_handler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(taskmapper) ⇒ ProviderHandler

Returns a new instance of ProviderHandler.



22
23
24
# File 'lib/tm/provider_handler.rb', line 22

def initialize(taskmapper)
  @taskmapper = taskmapper
end

Instance Attribute Details

#taskmapperObject (readonly)

Returns the value of attribute taskmapper.



20
21
22
# File 'lib/tm/provider_handler.rb', line 20

def taskmapper
  @taskmapper
end

Class Method Details

.build_handler(provider, authentication) ⇒ Object



26
27
28
29
30
31
# File 'lib/tm/provider_handler.rb', line 26

def self.build_handler(provider, authentication)
  self.new(TaskMapper.new(provider.to_sym, 
                          authentication.extend(TM::StringExtensions).to_hash))
rescue NameError
  raise TM::InvalidProvider, "Provider doesn't exists" 
end