Class: Sistrix::Domain::Overview
- Inherits:
-
Object
- Object
- Sistrix::Domain::Overview
- Includes:
- Base
- Defined in:
- lib/sistrix/domain/overview.rb
Defined Under Namespace
Classes: Record
Instance Attribute Summary collapse
-
#age ⇒ Object
readonly
Returns the value of attribute age.
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#kwcount_sem ⇒ Object
readonly
Returns the value of attribute kwcount_sem.
-
#kwcount_seo ⇒ Object
readonly
Returns the value of attribute kwcount_seo.
-
#pagerank ⇒ Object
readonly
Returns the value of attribute pagerank.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#sichtbarkeitsindex ⇒ Object
readonly
Returns the value of attribute sichtbarkeitsindex.
Instance Method Summary collapse
- #call(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Overview
constructor
A new instance of Overview.
Methods included from Base
#base_uri, #fetch, #method_name
Constructor Details
#initialize(options = {}) ⇒ Overview
Returns a new instance of Overview.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sistrix/domain/overview.rb', line 12 def initialize( = {}) @options = { 'domain' => nil, 'api_key' => Sistrix.config.api_key, }.merge() if Sistrix.config.proxy RestClient.proxy = Sistrix.config.proxy end end |
Instance Attribute Details
#age ⇒ Object (readonly)
Returns the value of attribute age.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def age @age end |
#credits ⇒ Object (readonly)
Returns the value of attribute credits.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def credits @credits end |
#kwcount_sem ⇒ Object (readonly)
Returns the value of attribute kwcount_sem.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def kwcount_sem @kwcount_sem end |
#kwcount_seo ⇒ Object (readonly)
Returns the value of attribute kwcount_seo.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def kwcount_seo @kwcount_seo end |
#pagerank ⇒ Object (readonly)
Returns the value of attribute pagerank.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def pagerank @pagerank end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def pages @pages end |
#sichtbarkeitsindex ⇒ Object (readonly)
Returns the value of attribute sichtbarkeitsindex.
9 10 11 |
# File 'lib/sistrix/domain/overview.rb', line 9 def @sichtbarkeitsindex end |
Instance Method Details
#call(options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sistrix/domain/overview.rb', line 23 def call( = {}) data = fetch() @credits = data.xpath('//credits').first['used'].to_i @sichtbarkeitsindex = Record.new(data.xpath('//answer/sichtbarkeitsindex').first) @pagerank = Record.new(data.xpath('//answer/pagerank').first) @pages = Record.new(data.xpath('//answer/pages').first) @age = Record.new(data.xpath('//answer/age').first) @kwcount_seo = Record.new(data.xpath('//answer/kwcount.seo').first) @kwcount_sem = Record.new(data.xpath('//answer/kwcount.sem').first) self end |