Class: Emb::Proxy
- Inherits:
-
Object
- Object
- Emb::Proxy
- Defined in:
- lib/emb/proxy.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #[](text, *texts) ⇒ Object
-
#initialize(client, name) ⇒ Proxy
constructor
A new instance of Proxy.
- #inspect ⇒ Object
Constructor Details
#initialize(client, name) ⇒ Proxy
Returns a new instance of Proxy.
7 8 9 10 |
# File 'lib/emb/proxy.rb', line 7 def initialize(client, name) @client = client @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/emb/proxy.rb', line 5 def name @name end |
Instance Method Details
#[](text, *texts) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/emb/proxy.rb', line 12 def [](text, *texts) set = Array(@client.send_command('EMB', @name.to_s, text, *texts)) result = set.map { |entry| entry.unpack('e*') } return result.first if result.size == 1 result end |
#inspect ⇒ Object
21 22 23 |
# File 'lib/emb/proxy.rb', line 21 def inspect "#<Emb::Proxy #{@name}>" end |