Exception: Pocolog::Upgrade::CannotAddNonContainerField
- Inherits:
-
InvalidCast
- Object
- ArgumentError
- InvalidCast
- Pocolog::Upgrade::CannotAddNonContainerField
- Defined in:
- lib/pocolog/upgrade/exceptions.rb
Instance Attribute Summary collapse
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, field_name) ⇒ CannotAddNonContainerField
constructor
A new instance of CannotAddNonContainerField.
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(type, field_name) ⇒ CannotAddNonContainerField
Returns a new instance of CannotAddNonContainerField
42 43 44 45 |
# File 'lib/pocolog/upgrade/exceptions.rb', line 42 def initialize(type, field_name) @type = type @field_name = field_name end |
Instance Attribute Details
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name
40 41 42 |
# File 'lib/pocolog/upgrade/exceptions.rb', line 40 def field_name @field_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type
39 40 41 |
# File 'lib/pocolog/upgrade/exceptions.rb', line 39 def type @type end |
Instance Method Details
#pretty_print(pp) ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/pocolog/upgrade/exceptions.rb', line 47 def pretty_print(pp) pp.text "cannot automatically convert if the new type adds a non-container field" pp.breakable pp.text "#{type.name} adds #{field_name}" pp.breakable pp.nest(2) do pp.breakable type.pretty_print(pp) end end |