Class: Rack::DetectRobotsResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_detect_robots.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(robot_name) ⇒ DetectRobotsResult

Returns a new instance of DetectRobotsResult.



6
7
8
9
# File 'lib/rack_detect_robots.rb', line 6

def initialize(robot_name)
  @robot_name=robot_name
  @is_robot = !!robot_name #no name no robot
end

Instance Attribute Details

#robot_nameObject (readonly)

Returns the value of attribute robot_name.



10
11
12
# File 'lib/rack_detect_robots.rb', line 10

def robot_name
  @robot_name
end

Class Method Details

.no_robotObject



3
4
5
# File 'lib/rack_detect_robots.rb', line 3

def self.no_robot
  new(nil)
end

Instance Method Details

#robot?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rack_detect_robots.rb', line 11

def robot?
  @is_robot
end