Class: Rapid::Template::Pulling::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rapid/template/pulling/base.rb

Direct Known Subclasses

Explicit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Base

Returns a new instance of Base.



12
13
14
15
# File 'lib/rapid/template/pulling/base.rb', line 12

def initialize content
  @result = {}
  @previous_content = ""
end

Instance Attribute Details

#previous_contentObject (readonly)

Returns the value of attribute previous_content.



7
8
9
# File 'lib/rapid/template/pulling/base.rb', line 7

def previous_content
  @previous_content
end

#resultObject (readonly)

Returns the value of attribute result.



7
8
9
# File 'lib/rapid/template/pulling/base.rb', line 7

def result
  @result
end

Instance Method Details

#contentObject

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/rapid/template/pulling/base.rb', line 30

def content
  raise NotImplementedError.new
end

#empty!Object

Raises:

  • (NotImplementedError)


58
59
60
# File 'lib/rapid/template/pulling/base.rb', line 58

def empty!
  raise NotImplementedError.new
end

#index(content) ⇒ Object

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/rapid/template/pulling/base.rb', line 34

def index content
  raise NotImplementedError.new
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rapid/template/pulling/base.rb', line 17

def key? key
  @result.key? key
end

#match(content) ⇒ Object

Raises:

  • (NotImplementedError)


50
51
52
# File 'lib/rapid/template/pulling/base.rb', line 50

def match content
  raise NotImplementedError.new
end

#match!(content) ⇒ Object

Raises:

  • (NotImplementedError)


54
55
56
# File 'lib/rapid/template/pulling/base.rb', line 54

def match! content
  raise NotImplementedError.new
end

#move!(count) ⇒ Object

Raises:

  • (NotImplementedError)


46
47
48
# File 'lib/rapid/template/pulling/base.rb', line 46

def move! count
  raise NotImplementedError.new
end

#raise_not_matching(content) ⇒ Object



26
27
28
# File 'lib/rapid/template/pulling/base.rb', line 26

def raise_not_matching content
  raise Rapid::NotMatchingTemplateError.new(result, content, self.content, :previous => previous_content)
end

#starts_with(content) ⇒ Object

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/rapid/template/pulling/base.rb', line 42

def starts_with content
  raise NotImplementedError.new
end

#starts_with?(content) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


38
39
40
# File 'lib/rapid/template/pulling/base.rb', line 38

def starts_with? content
  raise NotImplementedError.new
end

#to_hashObject



21
22
23
24
# File 'lib/rapid/template/pulling/base.rb', line 21

def to_hash
  remove_covered_namespaces!
  @result
end