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.
150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/must_be/core.rb', line 150 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.
147 148 149 |
# File 'lib/must_be/core.rb', line 147 def @additional_message end |
#args ⇒ Object
Returns the value of attribute args.
147 148 149 |
# File 'lib/must_be/core.rb', line 147 def args @args end |
#assertion ⇒ Object
Returns the value of attribute assertion.
147 148 149 |
# File 'lib/must_be/core.rb', line 147 def assertion @assertion end |
#block ⇒ Object
Returns the value of attribute block.
147 148 149 |
# File 'lib/must_be/core.rb', line 147 def block @block end |
#prefix ⇒ Object
Returns the value of attribute prefix.
147 148 149 |
# File 'lib/must_be/core.rb', line 147 def prefix @prefix end |
#receiver ⇒ Object
Returns the value of attribute receiver.
147 148 149 |
# File 'lib/must_be/core.rb', line 147 def receiver @receiver end |
Instance Method Details
#backtrace ⇒ Object
174 175 176 177 178 |
# File 'lib/must_be/core.rb', line 174 def backtrace complete_backtrace and complete_backtrace.drop_while do |line| line =~ %r{lib/must_be.*\.rb:} end end |
#complete_backtrace ⇒ Object
172 |
# File 'lib/must_be/core.rb', line 172 alias complete_backtrace backtrace |
#to_s ⇒ Object
163 164 165 166 167 168 169 170 |
# File 'lib/must_be/core.rb', line 163 def to_s if assertion "#{prefix}#{MustBe.short_inspect(receiver)}."\ "#{assertion}#{format_args_and_block}#{}" else super end end |