class Sistrix::Monitoring::Projects
Attributes
credits[R]
projects[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/sistrix/monitoring/projects.rb, line 11 def initialize(options = {}) @options = { 'api_key' => Sistrix.config.api_key, } if Sistrix.config.proxy RestClient.proxy = Sistrix.config.proxy end end
Public Instance Methods
call(options = {})
click to toggle source
# File lib/sistrix/monitoring/projects.rb, line 21 def call(options = {}) data = fetch(options) @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