Class: Kodi::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, method_groups = nil) ⇒ Client

Returns a new instance of Client.



5
6
7
8
# File 'lib/kodi/client.rb', line 5

def initialize(uri, method_groups = nil)
  @uri = URI.parse(uri)
  @namespaces = NamespaceBuilder.new(self.uri).build_namespaces(method_groups)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *arguments, &block) ⇒ Object



10
11
12
# File 'lib/kodi/client.rb', line 10

def method_missing(method_name, *arguments, &block)
  find_namespace(method_name) || super
end

Instance Attribute Details

#namespacesObject (readonly)

Returns the value of attribute namespaces.



3
4
5
# File 'lib/kodi/client.rb', line 3

def namespaces
  @namespaces
end

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/kodi/client.rb', line 3

def uri
  @uri
end