Class: Asuka::Rules::Abstract

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

Direct Known Subclasses

Blockquote, Header, Initial, Paragraph, Rule, UnorderedList

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(acc, result, line_formatter) ⇒ Abstract

Returns a new instance of Abstract.



17
18
19
20
21
# File 'lib/asuka/rules.rb', line 17

def initialize(acc, result, line_formatter)
  @acc            = acc
  @result         = result
  @line_formatter = line_formatter
end

Instance Attribute Details

#accObject (readonly)

Returns the value of attribute acc.



15
16
17
# File 'lib/asuka/rules.rb', line 15

def acc
  @acc
end

#line_formatterObject (readonly)

Returns the value of attribute line_formatter.



15
16
17
# File 'lib/asuka/rules.rb', line 15

def line_formatter
  @line_formatter
end

#resultObject (readonly)

Returns the value of attribute result.



15
16
17
# File 'lib/asuka/rules.rb', line 15

def result
  @result
end

Instance Method Details

#match?(line) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/asuka/rules.rb', line 23

def match?(line)
  raise NotImplementedError, "%s does not implement the #match? method" % [self.class.name]
end

#process(line) ⇒ Object



31
32
33
# File 'lib/asuka/rules.rb', line 31

def process(line)
  # no-op
end

#transitionObject



27
28
29
# File 'lib/asuka/rules.rb', line 27

def transition
  # no-op
end