class RubyNos::RemoteAgent
Attributes
endpoints[RW]
rest_api[RW]
timestamp[RW]
uuid[RW]
Public Instance Methods
add_endpoint(*args)
click to toggle source
# File lib/ruby_nos/remote_agent.rb, line 10 def add_endpoint *args endpoints << Endpoint.new(*args) end
endpoints_collection()
click to toggle source
# File lib/ruby_nos/remote_agent.rb, line 14 def endpoints_collection endpoints.map{|e| e.to_hash} end
same_api?(another_agent)
click to toggle source
# File lib/ruby_nos/remote_agent.rb, line 22 def same_api? another_agent if rest_api && another_agent.rest_api rest_api.to_hash == another_agent.rest_api.to_hash else false end end
same_endpoints?(another_agent)
click to toggle source
# File lib/ruby_nos/remote_agent.rb, line 18 def same_endpoints? another_agent endpoints_collection == another_agent.endpoints_collection end
same_timestamp?(another_agent)
click to toggle source
# File lib/ruby_nos/remote_agent.rb, line 30 def same_timestamp? another_agent timestamp == another_agent.timestamp end
to_hash()
click to toggle source
# File lib/ruby_nos/remote_agent.rb, line 34 def to_hash { uuid: uuid, timestamp: Time.at(timestamp/1000) } end