class Scruber::Helpers::UserAgentRotator::UserAgent

Attributes

name[RW]
tags[RW]

Public Class Methods

new(name, options={}) click to toggle source
# File lib/scruber/helpers/user_agent_rotator.rb, line 8
def initialize(name, options={})
  @name = name
  raise Scruber::ArgumentError.new("You need to specify name") if @name.blank?
  @tags = options.fetch(:tags){ [] } || []
  if !@tags.is_a?(Array)
    @tags = [@tags]
  end
  @tags = @tags.compact.map(&:to_sym)
end

Public Instance Methods

id() click to toggle source
# File lib/scruber/helpers/user_agent_rotator.rb, line 18
def id
  @name
end