Exception: ActiveItem::InvalidGsiKeyTypeError
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveItem::InvalidGsiKeyTypeError
- Defined in:
- lib/active_item/errors.rb
Overview
Raised when a GSI key attribute has an invalid type. DynamoDB GSI keys must be String, Number (Integer/Float/BigDecimal), or Binary (StringIO).
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#index_name ⇒ Object
readonly
Returns the value of attribute index_name.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#value_type ⇒ Object
readonly
Returns the value of attribute value_type.
Instance Method Summary collapse
-
#initialize(model_name:, attribute:, index_name:, value:) ⇒ InvalidGsiKeyTypeError
constructor
A new instance of InvalidGsiKeyTypeError.
Constructor Details
#initialize(model_name:, attribute:, index_name:, value:) ⇒ InvalidGsiKeyTypeError
Returns a new instance of InvalidGsiKeyTypeError.
91 92 93 94 95 96 97 98 99 |
# File 'lib/active_item/errors.rb', line 91 def initialize(model_name:, attribute:, index_name:, value:) @model_name = model_name @attribute = attribute @index_name = index_name @value = value @value_type = value.class.name super("#{model_name}##{attribute} has invalid type #{@value_type} for GSI '#{index_name}'. " \ 'GSI keys must be String, Numeric (Integer/Float/BigDecimal), or Binary (StringIO).') end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
89 90 91 |
# File 'lib/active_item/errors.rb', line 89 def attribute @attribute end |
#index_name ⇒ Object (readonly)
Returns the value of attribute index_name.
89 90 91 |
# File 'lib/active_item/errors.rb', line 89 def index_name @index_name end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
89 90 91 |
# File 'lib/active_item/errors.rb', line 89 def model_name @model_name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
89 90 91 |
# File 'lib/active_item/errors.rb', line 89 def value @value end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
89 90 91 |
# File 'lib/active_item/errors.rb', line 89 def value_type @value_type end |