Class: Sistrix::Monitoring::Folders
- Inherits:
-
Object
- Object
- Sistrix::Monitoring::Folders
- Includes:
- Base
- Defined in:
- lib/sistrix/monitoring/folders.rb
Defined Under Namespace
Classes: Record
Instance Attribute Summary collapse
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#folders ⇒ Object
readonly
Returns the value of attribute folders.
Instance Method Summary collapse
- #call(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Folders
constructor
A new instance of Folders.
Methods included from Base
#base_uri, #fetch, #method_name
Constructor Details
#initialize(options = {}) ⇒ Folders
Returns a new instance of Folders.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sistrix/monitoring/folders.rb', line 11 def initialize( = {}) @options = { 'project' => nil, 'api_key' => Sistrix.config.api_key, }.merge() if Sistrix.config.proxy RestClient.proxy = Sistrix.config.proxy end end |
Instance Attribute Details
#credits ⇒ Object (readonly)
Returns the value of attribute credits.
9 10 11 |
# File 'lib/sistrix/monitoring/folders.rb', line 9 def credits @credits end |
#folders ⇒ Object (readonly)
Returns the value of attribute folders.
9 10 11 |
# File 'lib/sistrix/monitoring/folders.rb', line 9 def folders @folders end |
Instance Method Details
#call(options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sistrix/monitoring/folders.rb', line 22 def call( = {}) data = fetch() @credits = data.xpath('/response/credits').first['used'].to_i @folders = [] data.xpath('/response/answer/folder').each do |r| @folders << Record.new(r) end self end |