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.
-
#response ⇒ Object
Returns the value of attribute response.
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 9 |
# File 'app/serializers/spree/error_serializer.rb', line 5 def initialize(resource, = {}) @resource = resource @response = .delete(:response) = 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 |
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'app/serializers/spree/error_serializer.rb', line 3 def response @response end |
Instance Method Details
#as_json ⇒ Object
11 12 13 |
# File 'app/serializers/spree/error_serializer.rb', line 11 def as_json { errors: }.to_json end |