Exception: MustBe::Note
Overview
Note ###
Direct Known Subclasses
Instance Attribute Summary collapse
-
#additional_message ⇒ Object
Returns the value of attribute additional_message.
-
#args ⇒ Object
Returns the value of attribute args.
-
#assertion ⇒ Object
Returns the value of attribute assertion.
-
#block ⇒ Object
Returns the value of attribute block.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Method Summary collapse
- #backtrace ⇒ Object
- #complete_backtrace ⇒ Object
-
#initialize(receiver, assertion = nil, args = nil, block = nil, additional_message = nil) ⇒ Note
constructor
A new instance of Note.
- #to_s ⇒ Object
Constructor Details
#initialize(receiver, assertion = nil, args = nil, block = nil, additional_message = nil) ⇒ Note
Returns a new instance of Note.
151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/must_be/core.rb', line 151 def initialize(receiver, assertion = nil, args = nil, block = nil, = nil) if assertion @receiver = receiver @assertion = assertion @args = args @block = block @additional_message = else super(receiver) end end |
Instance Attribute Details
#additional_message ⇒ Object
Returns the value of attribute additional_message.
148 149 150 |
# File 'lib/must_be/core.rb', line 148 def @additional_message end |
#args ⇒ Object
Returns the value of attribute args.
148 149 150 |
# File 'lib/must_be/core.rb', line 148 def args @args end |
#assertion ⇒ Object
Returns the value of attribute assertion.
148 149 150 |
# File 'lib/must_be/core.rb', line 148 def assertion @assertion end |
#block ⇒ Object
Returns the value of attribute block.
148 149 150 |
# File 'lib/must_be/core.rb', line 148 def block @block end |
#prefix ⇒ Object
Returns the value of attribute prefix.
148 149 150 |
# File 'lib/must_be/core.rb', line 148 def prefix @prefix end |
#receiver ⇒ Object
Returns the value of attribute receiver.
148 149 150 |
# File 'lib/must_be/core.rb', line 148 def receiver @receiver end |
Instance Method Details
#backtrace ⇒ Object
175 176 177 178 179 |
# File 'lib/must_be/core.rb', line 175 def backtrace complete_backtrace and complete_backtrace.drop_while do |line| line =~ %r{lib/must_be.*\.rb:} end end |
#complete_backtrace ⇒ Object
173 |
# File 'lib/must_be/core.rb', line 173 alias complete_backtrace backtrace |
#to_s ⇒ Object
164 165 166 167 168 169 170 171 |
# File 'lib/must_be/core.rb', line 164 def to_s if assertion "#{prefix}#{MustBe.short_inspect(receiver)}."\ "#{assertion}#{format_args_and_block}#{}" else super end end |