Class: HParser::Block::SeeMore

Inherits:
Object
  • Object
show all
Includes:
Collectable
Defined in:
lib/hparser/block/see_more.rb,
lib/hparser/html.rb,
lib/hparser/text.rb,
lib/hparser/latex.rb

Overview

SeeMore line parser.

or =====

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(is_super) ⇒ SeeMore

Returns a new instance of SeeMore.



22
23
24
# File 'lib/hparser/block/see_more.rb', line 22

def initialize(is_super)
  @is_super = is_super
end

Instance Attribute Details

#is_superObject (readonly)

Returns the value of attribute is_super.



21
22
23
# File 'lib/hparser/block/see_more.rb', line 21

def is_super
  @is_super
end

Class Method Details

.parse(scanner, context, inlines) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/hparser/block/see_more.rb', line 13

def self.parse(scanner,context,inlines)
  if scanner.scan('=====')
    SeeMore.new true
  elsif scanner.scan('====') then
    SeeMore.new false
  end
end

Instance Method Details

#==(o) ⇒ Object



26
27
28
# File 'lib/hparser/block/see_more.rb', line 26

def ==(o)
  o.class == self.class and o.is_super == self.is_super
end

#to_htmlObject



103
104
105
106
107
108
109
# File 'lib/hparser/html.rb', line 103

def to_html()
  if self.is_super
    '<a name="seeall"></a>'
  else
    '<a name="seemore"></a>'
  end
end

#to_latexObject



78
# File 'lib/hparser/latex.rb', line 78

def to_latex() '' end

#to_textObject



43
# File 'lib/hparser/text.rb', line 43

def to_text() "" end