Class: Spree::ErrorSerializer
- Inherits:
-
Object
- Object
- Spree::ErrorSerializer
- Defined in:
- app/serializers/spree/error_serializer.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(resource, options = {}) ⇒ ErrorSerializer
constructor
A new instance of ErrorSerializer.
Constructor Details
#initialize(resource, options = {}) ⇒ ErrorSerializer
Returns a new instance of ErrorSerializer.
5 6 7 8 |
# File 'app/serializers/spree/error_serializer.rb', line 5 def initialize(resource, = {}) @resource = resource = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'app/serializers/spree/error_serializer.rb', line 3 def end |
#resource ⇒ Object
Returns the value of attribute resource.
3 4 5 |
# File 'app/serializers/spree/error_serializer.rb', line 3 def resource @resource end |
Instance Method Details
#as_json ⇒ Object
10 11 12 |
# File 'app/serializers/spree/error_serializer.rb', line 10 def as_json { errors: }.to_json end |