Class: Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/borderbot/agent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAgent

Returns a new instance of Agent.



10
11
12
13
14
15
# File 'lib/borderbot/agent.rb', line 10

def initialize
    @bwt_url = Qcore.new.bwt_url
    @ports = nil
    @executed_at = nil
    compute
end

Instance Attribute Details

#bwt_urlObject (readonly)

Returns the value of attribute bwt_url.



8
9
10
# File 'lib/borderbot/agent.rb', line 8

def bwt_url
  @bwt_url
end

#executed_atObject (readonly)

Returns the value of attribute executed_at.



8
9
10
# File 'lib/borderbot/agent.rb', line 8

def executed_at
  @executed_at
end

#portsObject (readonly)

Returns the value of attribute ports.



8
9
10
# File 'lib/borderbot/agent.rb', line 8

def ports
  @ports
end

Instance Method Details

#computeObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/borderbot/agent.rb', line 17

def compute
  #New Query Core instance
  queryCore  = Qcore.new
  #Get XML data from BWT website
  bwtXML = queryCore.get_bwt_xml_data
  #set the ordereded ports into @ports
  @ports = queryCore.extract_ports(bwtXML)
  #set the last execution time
  @executed_at = DateTime.now
end