Exception: MustBe::ContainerNote
- Extended by:
- Forwardable
- Defined in:
- lib/must_be/containers.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#container ⇒ Object
Returns the value of attribute container.
-
#original_note ⇒ Object
Returns the value of attribute original_note.
Attributes inherited from Note
#additional_message, #args, #assertion, #block, #prefix, #receiver
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(original_note, container = nil) ⇒ ContainerNote
constructor
A new instance of ContainerNote.
- #regular_backtrace ⇒ Object
- #to_s ⇒ Object
Methods inherited from Note
Constructor Details
#initialize(original_note, container = nil) ⇒ ContainerNote
Returns a new instance of ContainerNote.
17 18 19 20 |
# File 'lib/must_be/containers.rb', line 17 def initialize(original_note, container = nil) @original_note = original_note @container = container end |
Instance Attribute Details
#container ⇒ Object
Returns the value of attribute container.
7 8 9 |
# File 'lib/must_be/containers.rb', line 7 def container @container end |
#original_note ⇒ Object
Returns the value of attribute original_note.
7 8 9 |
# File 'lib/must_be/containers.rb', line 7 def original_note @original_note end |
Instance Method Details
#backtrace ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/must_be/containers.rb', line 32 def backtrace return unless regular_backtrace if container.respond_to?(:must_only_ever_contain_backtrace) and container.must_only_ever_contain_backtrace regular_backtrace+["=== caused by container ==="]+ container.must_only_ever_contain_backtrace else regular_backtrace end end |
#regular_backtrace ⇒ Object
30 |
# File 'lib/must_be/containers.rb', line 30 alias regular_backtrace backtrace |
#to_s ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/must_be/containers.rb', line 22 def to_s if assertion @original_note.to_s+" in container #{MustBe.short_inspect(container)}" else @original_note.to_s end end |