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.



148
149
150
151
152
# File 'lib/azebiki/azebiki.rb', line 148

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



163
164
165
# File 'lib/azebiki/azebiki.rb', line 163

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

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



146
147
148
# File 'lib/azebiki/azebiki.rb', line 146

def contents
  @contents
end

#failure_messageObject (readonly)

Returns the value of attribute failure_message.



146
147
148
# File 'lib/azebiki/azebiki.rb', line 146

def failure_message
  @failure_message
end

#tagsObject (readonly)

Returns the value of attribute tags.



146
147
148
# File 'lib/azebiki/azebiki.rb', line 146

def tags
  @tags
end

Instance Method Details

#has_content(text) ⇒ Object



154
155
156
# File 'lib/azebiki/azebiki.rb', line 154

def has_content(text)
  @contents << text
end

#p(*args, &block) ⇒ Object

special case for BlankSlate



159
160
161
# File 'lib/azebiki/azebiki.rb', line 159

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