class Sistrix::Domain::Pages

Attributes

credits[R]
pages[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/sistrix/domain/pages.rb, line 11
def initialize(options = {})
  @options = {
    'history' => nil,
    'domain' => nil,
    'api_key' => Sistrix.config.api_key,
  }.merge(options)

  if Sistrix.config.proxy
    RestClient.proxy = Sistrix.config.proxy
  end
end

Public Instance Methods

call(options = {}) click to toggle source
# File lib/sistrix/domain/pages.rb, line 23
def call(options = {})
  data = fetch(options)

  @credits = data.xpath('//credits').first['used'].to_i
  @pages = []
  data.xpath('//answer/pages').each do |o|
    @pages << Record.new(o)
  end

  self
end