Class: Pili::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mac) ⇒ Client

Returns a new instance of Client.



7
8
9
10
# File 'lib/pili/client.rb', line 7

def initialize(mac)
  @mac = mac
  @rpc = RPC.new mac
end

Instance Attribute Details

#macObject (readonly)

Returns the value of attribute mac.



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

def mac
  @mac
end

#rpcObject (readonly)

Returns the value of attribute rpc.



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

def rpc
  @rpc
end

Instance Method Details

#hub(hub_name) ⇒ Object

hub 初始化一个 Hub.



13
14
15
# File 'lib/pili/client.rb', line 13

def hub(hub_name)
  Hub.new hub_name, self
end