Class: Azebiki::Checker::MatcherBuilder
- Inherits:
- BasicObject
- Defined in:
- lib/azebiki/azebiki.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #has_content(text) ⇒ Object
-
#initialize(&block) ⇒ MatcherBuilder
constructor
A new instance of MatcherBuilder.
- #method_missing(method, *args, &block) ⇒ Object
-
#p(*args, &block) ⇒ Object
special case for BlankSlate.
Constructor Details
#initialize(&block) ⇒ MatcherBuilder
Returns a new instance of MatcherBuilder.
140 141 142 143 144 |
# File 'lib/azebiki/azebiki.rb', line 140 def initialize(&block) @tags = [] @contents = [] instance_eval &block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
155 156 157 |
# File 'lib/azebiki/azebiki.rb', line 155 def method_missing(method, *args, &block) handle_tag(method, *args, &block) end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
138 139 140 |
# File 'lib/azebiki/azebiki.rb', line 138 def contents @contents end |
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
138 139 140 |
# File 'lib/azebiki/azebiki.rb', line 138 def @failure_message end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
138 139 140 |
# File 'lib/azebiki/azebiki.rb', line 138 def @tags end |
Instance Method Details
#has_content(text) ⇒ Object
146 147 148 |
# File 'lib/azebiki/azebiki.rb', line 146 def has_content(text) @contents << text end |
#p(*args, &block) ⇒ Object
special case for BlankSlate
151 152 153 |
# File 'lib/azebiki/azebiki.rb', line 151 def p(*args, &block) handle_tag(:p, *args, &block) end |