Class: Rapid::Template::Pulling::Base
- Inherits:
-
Object
- Object
- Rapid::Template::Pulling::Base
- Defined in:
- lib/rapid/template/pulling/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#previous_content ⇒ Object
readonly
Returns the value of attribute previous_content.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #content ⇒ Object
- #empty! ⇒ Object
- #index(content) ⇒ Object
-
#initialize(content) ⇒ Base
constructor
A new instance of Base.
- #key?(key) ⇒ Boolean
- #match(content) ⇒ Object
- #match!(content) ⇒ Object
- #move!(count) ⇒ Object
- #raise_not_matching(content) ⇒ Object
- #starts_with(content) ⇒ Object
- #starts_with?(content) ⇒ Boolean
- #to_hash ⇒ Object
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_content ⇒ Object (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 |
#result ⇒ Object (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
#content ⇒ Object
30 31 32 |
# File 'lib/rapid/template/pulling/base.rb', line 30 def content raise NotImplementedError.new end |
#empty! ⇒ Object
58 59 60 |
# File 'lib/rapid/template/pulling/base.rb', line 58 def empty! raise NotImplementedError.new end |
#index(content) ⇒ Object
34 35 36 |
# File 'lib/rapid/template/pulling/base.rb', line 34 def index content raise NotImplementedError.new end |
#key?(key) ⇒ Boolean
17 18 19 |
# File 'lib/rapid/template/pulling/base.rb', line 17 def key? key @result.key? key end |
#match(content) ⇒ Object
50 51 52 |
# File 'lib/rapid/template/pulling/base.rb', line 50 def match content raise NotImplementedError.new end |
#match!(content) ⇒ Object
54 55 56 |
# File 'lib/rapid/template/pulling/base.rb', line 54 def match! content raise NotImplementedError.new end |
#move!(count) ⇒ Object
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
42 43 44 |
# File 'lib/rapid/template/pulling/base.rb', line 42 def starts_with content raise NotImplementedError.new end |
#starts_with?(content) ⇒ Boolean
38 39 40 |
# File 'lib/rapid/template/pulling/base.rb', line 38 def starts_with? content raise NotImplementedError.new end |
#to_hash ⇒ Object
21 22 23 24 |
# File 'lib/rapid/template/pulling/base.rb', line 21 def to_hash remove_covered_namespaces! @result end |