Class: Sistrix::Domain::Sichtbarkeitsindex
- Inherits:
-
Object
- Object
- Sistrix::Domain::Sichtbarkeitsindex
- Includes:
- Base
- Defined in:
- lib/sistrix/domain/sichtbarkeitsindex.rb
Defined Under Namespace
Classes: Record
Instance Attribute Summary collapse
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#sichtbarkeitsindex ⇒ Object
readonly
Returns the value of attribute sichtbarkeitsindex.
Instance Method Summary collapse
- #call(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Sichtbarkeitsindex
constructor
A new instance of Sichtbarkeitsindex.
Methods included from Base
#base_uri, #fetch, #method_name
Constructor Details
#initialize(options = {}) ⇒ Sichtbarkeitsindex
Returns a new instance of Sichtbarkeitsindex.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sistrix/domain/sichtbarkeitsindex.rb', line 10 def initialize( = {}) @options = { 'history' => nil, 'domain' => 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.
8 9 10 |
# File 'lib/sistrix/domain/sichtbarkeitsindex.rb', line 8 def credits @credits end |
#sichtbarkeitsindex ⇒ Object (readonly)
Returns the value of attribute sichtbarkeitsindex.
8 9 10 |
# File 'lib/sistrix/domain/sichtbarkeitsindex.rb', line 8 def @sichtbarkeitsindex end |
Instance Method Details
#call(options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sistrix/domain/sichtbarkeitsindex.rb', line 22 def call( = {}) data = fetch() @credits = data.xpath('//credits').first['used'].to_i @sichtbarkeitsindex = [] data.xpath('//answer/sichtbarkeitsindex').each do |o| @sichtbarkeitsindex << Record.new(o) end self end |