Class: Kodi::Client
- Inherits:
-
Object
- Object
- Kodi::Client
- Defined in:
- lib/kodi/client.rb
Instance Attribute Summary collapse
-
#namespaces ⇒ Object
readonly
Returns the value of attribute namespaces.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, method_groups = nil) ⇒ Client
constructor
A new instance of Client.
- #method_missing(method_name, *arguments, &block) ⇒ Object
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
#namespaces ⇒ Object (readonly)
Returns the value of attribute namespaces.
3 4 5 |
# File 'lib/kodi/client.rb', line 3 def namespaces @namespaces end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/kodi/client.rb', line 3 def uri @uri end |