Exception: MustBe::PairNote
- Inherits:
-
ContainerNote
- Object
- StandardError
- Note
- ContainerNote
- MustBe::PairNote
- Defined in:
- lib/must_be/containers.rb
Instance Attribute Summary collapse
-
#cases ⇒ Object
Returns the value of attribute cases.
-
#key ⇒ Object
Returns the value of attribute key.
-
#negate ⇒ Object
Returns the value of attribute negate.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from ContainerNote
Attributes inherited from Note
#additional_message, #args, #assertion, #block, #prefix, #receiver
Instance Method Summary collapse
-
#initialize(key, value, cases, container, negate) ⇒ PairNote
constructor
A new instance of PairNote.
- #to_s ⇒ Object
Methods inherited from ContainerNote
#backtrace, #regular_backtrace
Methods inherited from Note
#backtrace, #complete_backtrace
Constructor Details
#initialize(key, value, cases, container, negate) ⇒ PairNote
Returns a new instance of PairNote.
48 49 50 51 52 53 54 |
# File 'lib/must_be/containers.rb', line 48 def initialize(key, value, cases, container, negate) super(Note.new(""), container) @key = key @value = value @cases = cases @negate = negate end |
Instance Attribute Details
#cases ⇒ Object
Returns the value of attribute cases.
46 47 48 |
# File 'lib/must_be/containers.rb', line 46 def cases @cases end |
#key ⇒ Object
Returns the value of attribute key.
46 47 48 |
# File 'lib/must_be/containers.rb', line 46 def key @key end |
#negate ⇒ Object
Returns the value of attribute negate.
46 47 48 |
# File 'lib/must_be/containers.rb', line 46 def negate @negate end |
#value ⇒ Object
Returns the value of attribute value.
46 47 48 |
# File 'lib/must_be/containers.rb', line 46 def value @value end |
Instance Method Details
#to_s ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/must_be/containers.rb', line 56 def to_s match = negate ? "matches" : "does not match" "#{prefix}pair {#{MustBe.short_inspect(key)}=>"\ "#{MustBe.short_inspect(value)}} #{match}"\ " #{MustBe.short_inspect(cases)} in"\ " container #{MustBe.short_inspect(container)}" end |