Class: NeptuneApex::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/neptune_apex/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Controller password



14
15
16
# File 'lib/neptune_apex/controller.rb', line 14

def password
  @password
end

#urlObject

Controller URL



8
9
10
# File 'lib/neptune_apex/controller.rb', line 8

def url
  @url
end

#userObject

Controller username



11
12
13
# File 'lib/neptune_apex/controller.rb', line 11

def user
  @user
end

Instance Method Details

#datalogObject

Get the datalog from the controller



26
27
28
# File 'lib/neptune_apex/controller.rb', line 26

def datalog
  Datalog.from_xml(open("#{@url}/cgi-bin/datalog.xml"))
end

#statusObject

Get the current status of the controller



19
20
21
# File 'lib/neptune_apex/controller.rb', line 19

def status
  Status.from_xml(open("#{@url}/cgi-bin/status.xml"))
end

#user_agentObject

Get a prepared UserAgent



32
33
34
35
36
37
38
39
# File 'lib/neptune_apex/controller.rb', line 32

def user_agent
  unless @user_agent
    @user_agent = HTTPClient.new
    @user_agent.set_auth(@url, @user, @password)
  end

  @user_agent
end