Class: Middleman::Robots::Generators::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-robots/generators/block.rb

Overview

Block

Generating Block in robots.txt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule) ⇒ Block

Returns a new instance of Block.



14
15
16
# File 'lib/middleman-robots/generators/block.rb', line 14

def initialize(rule)
  @rule = rule
end

Instance Attribute Details

#ruleObject

Returns the value of attribute rule.



12
13
14
# File 'lib/middleman-robots/generators/block.rb', line 12

def rule
  @rule
end

Instance Method Details

#textObject



18
19
20
21
22
23
24
# File 'lib/middleman-robots/generators/block.rb', line 18

def text
  [
    user_agent,
    disallow,
    allow
  ].compact.join("\n")
end