class Sistrix::Domain
Attributes
credits[R]
options[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/sistrix/domain.rb, line 10 def initialize(options = {}) @options = { '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.rb, line 21 def call(options = {}) data = fetch(options) @credits = data.xpath('//credits').first['used'].to_i @options = [] data.xpath('//answer/option').each do |o| @options << Record.new(o) end self end