Class: Discover::Service::Update
- Inherits:
-
Struct
- Object
- Struct
- Discover::Service::Update
- Defined in:
- lib/discover.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#created ⇒ Object
Returns the value of attribute created.
-
#name ⇒ Object
Returns the value of attribute name.
-
#online ⇒ Object
Returns the value of attribute online.
Class Method Summary collapse
Instance Method Summary collapse
- #offline? ⇒ Boolean
- #online? ⇒ Boolean
-
#sentinel? ⇒ Boolean
The sentinel update marks the end of existing updates from discoverd.
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address
121 122 123 |
# File 'lib/discover.rb', line 121 def address @address end |
#attributes ⇒ Object
Returns the value of attribute attributes
121 122 123 |
# File 'lib/discover.rb', line 121 def attributes @attributes end |
#created ⇒ Object
Returns the value of attribute created
121 122 123 |
# File 'lib/discover.rb', line 121 def created @created end |
#name ⇒ Object
Returns the value of attribute name
121 122 123 |
# File 'lib/discover.rb', line 121 def name @name end |
#online ⇒ Object
Returns the value of attribute online
121 122 123 |
# File 'lib/discover.rb', line 121 def online @online end |
Class Method Details
.from_hash(hash) ⇒ Object
122 123 124 |
# File 'lib/discover.rb', line 122 def self.from_hash(hash) new *hash.values_at("Addr", "Attrs", "Created", "Name", "Online") end |
Instance Method Details
#offline? ⇒ Boolean
134 135 136 |
# File 'lib/discover.rb', line 134 def offline? !online? end |
#online? ⇒ Boolean
130 131 132 |
# File 'lib/discover.rb', line 130 def online? online == true end |
#sentinel? ⇒ Boolean
The sentinel update marks the end of existing updates from discoverd
139 140 141 |
# File 'lib/discover.rb', line 139 def sentinel? address.empty? && name.empty? end |