Class: Azebiki::Checker::MatcherBuilder

Inherits:
BasicObject
Defined in:
lib/azebiki/azebiki.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ MatcherBuilder

Returns a new instance of MatcherBuilder.



172
173
174
175
176
# File 'lib/azebiki/azebiki.rb', line 172

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



187
188
189
# File 'lib/azebiki/azebiki.rb', line 187

def method_missing(method, *args, &block)
  handle_tag(method, *args, &block)
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



170
171
172
# File 'lib/azebiki/azebiki.rb', line 170

def contents
  @contents
end

#failure_messageObject (readonly)

Returns the value of attribute failure_message.



170
171
172
# File 'lib/azebiki/azebiki.rb', line 170

def failure_message
  @failure_message
end

#tagsObject (readonly)

Returns the value of attribute tags.



170
171
172
# File 'lib/azebiki/azebiki.rb', line 170

def tags
  @tags
end

Instance Method Details

#has_content(text) ⇒ Object



178
179
180
# File 'lib/azebiki/azebiki.rb', line 178

def has_content(text)
  @contents << text
end

#p(*args, &block) ⇒ Object

special case for BlankSlate



183
184
185
# File 'lib/azebiki/azebiki.rb', line 183

def p(*args, &block)
  handle_tag(:p, *args, &block)
end