Class: XBeeRuby::Response
- Inherits:
-
Object
- Object
- XBeeRuby::Response
show all
- Defined in:
- lib/xbee-ruby/response.rb
Constant Summary
collapse
- @@response_types =
{}
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.frame_type(type) ⇒ Object
17
18
19
|
# File 'lib/xbee-ruby/response.rb', line 17
def self.frame_type type
@@response_types[type] = self
end
|
.from_packet(packet) ⇒ Object
21
22
23
|
# File 'lib/xbee-ruby/response.rb', line 21
def self.from_packet packet
@@response_types[packet.data[0]].new packet.data rescue raise IOError, "Unknown response type 0x#{packet.data[0].to_s 16}"
end
|
Instance Method Details
#to_s ⇒ Object
25
26
27
|
# File 'lib/xbee-ruby/response.rb', line 25
def to_s
'Response'
end
|