Class: NSCA::Packet
- Inherits:
-
Object
- Object
- NSCA::Packet
- Defined in:
- lib/nsca/packet.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CSC32CheckFailed, VersionCheckFailed
Instance Attribute Summary collapse
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#return_code ⇒ Object
Returns the value of attribute return_code.
-
#service ⇒ Object
Returns the value of attribute service.
-
#status ⇒ Object
Returns the value of attribute status.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(timestamp, return_code, hostname, service, status) ⇒ Packet
constructor
A new instance of Packet.
Constructor Details
#initialize(timestamp, return_code, hostname, service, status) ⇒ Packet
Returns a new instance of Packet.
46 47 48 49 |
# File 'lib/nsca/packet.rb', line 46 def initialize , return_code, hostname, service, status @timestamp, @return_code, @hostname, @service, @status = Time.at( .to_f), return_code, hostname, service, status end |
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname.
51 52 53 |
# File 'lib/nsca/packet.rb', line 51 def hostname @hostname end |
#return_code ⇒ Object
Returns the value of attribute return_code.
51 52 53 |
# File 'lib/nsca/packet.rb', line 51 def return_code @return_code end |
#service ⇒ Object
Returns the value of attribute service.
51 52 53 |
# File 'lib/nsca/packet.rb', line 51 def service @service end |
#status ⇒ Object
Returns the value of attribute status.
51 52 53 |
# File 'lib/nsca/packet.rb', line 51 def status @status end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
51 52 53 |
# File 'lib/nsca/packet.rb', line 51 def @timestamp end |
Class Method Details
.register_version(version, klass) ⇒ Object
38 |
# File 'lib/nsca/packet.rb', line 38 def self.register_version( version, klass) versions[version] = klass end |
.versions(version = nil) ⇒ Object
33 34 35 36 |
# File 'lib/nsca/packet.rb', line 33 def self.versions version = nil @@versions ||= {} version ? @@versions[version] : @@versions end |