Class: Sistrix::Monitoring::Projects
- Inherits:
-
Object
- Object
- Sistrix::Monitoring::Projects
- Includes:
- Base
- Defined in:
- lib/sistrix/monitoring/projects.rb
Defined Under Namespace
Classes: Record
Instance Attribute Summary collapse
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#projects ⇒ Object
readonly
Returns the value of attribute projects.
Instance Method Summary collapse
- #call(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Projects
constructor
A new instance of Projects.
Methods included from Base
#base_uri, #fetch, #method_name
Constructor Details
Instance Attribute Details
#credits ⇒ Object (readonly)
Returns the value of attribute credits.
9 10 11 |
# File 'lib/sistrix/monitoring/projects.rb', line 9 def credits @credits end |
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
9 10 11 |
# File 'lib/sistrix/monitoring/projects.rb', line 9 def projects @projects end |
Instance Method Details
#call(options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sistrix/monitoring/projects.rb', line 21 def call( = {}) data = fetch() @credits = data.xpath('/response/credits').first['used'].to_i @projects = [] data.xpath('/response/answer/project').each do |r| @projects << Record.new(r) end self end |