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
129 130 131 |
# File 'lib/discover.rb', line 129 def address @address end |
#attributes ⇒ Object
Returns the value of attribute attributes
129 130 131 |
# File 'lib/discover.rb', line 129 def attributes @attributes end |
#created ⇒ Object
Returns the value of attribute created
129 130 131 |
# File 'lib/discover.rb', line 129 def created @created end |
#name ⇒ Object
Returns the value of attribute name
129 130 131 |
# File 'lib/discover.rb', line 129 def name @name end |
#online ⇒ Object
Returns the value of attribute online
129 130 131 |
# File 'lib/discover.rb', line 129 def online @online end |
Class Method Details
.from_hash(hash) ⇒ Object
130 131 132 |
# File 'lib/discover.rb', line 130 def self.from_hash(hash) new *hash.values_at("Addr", "Attrs", "Created", "Name", "Online") end |
Instance Method Details
#offline? ⇒ Boolean
142 143 144 |
# File 'lib/discover.rb', line 142 def offline? !online? end |
#online? ⇒ Boolean
138 139 140 |
# File 'lib/discover.rb', line 138 def online? online == true end |
#sentinel? ⇒ Boolean
The sentinel update marks the end of existing updates from discoverd
147 148 149 |
# File 'lib/discover.rb', line 147 def sentinel? address.empty? && name.empty? end |