Class: Wemote::Client

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

Defined Under Namespace

Modules: Manticore, NetHTTP, SmartLib, Typhoeus

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



74
75
76
# File 'lib/wemote/client.rb', line 74

def initialize
  extend Wemote::Client.technique
end

Class Method Details

.techniqueObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/wemote/client.rb', line 4

def self.technique
  @technique ||= begin
    constants.collect {|const_name| const_get(const_name)}.select {|const| const.class == Module}.detect do |mod|
      fulfilled = false
      begin
        next unless mod.const_defined?(:DEPENDENCIES)
        mod.const_get(:DEPENDENCIES).map{|d|require d}
        fulfilled = true
      rescue LoadError
      end
      fulfilled
    end
  end
end