lib/recurly/request.rb in recurly-3.0.0.beta.5 vs lib/recurly/request.rb in recurly-3.0.0
- old
+ new
@@ -3,26 +3,26 @@
# It's used to validate requests data as well as
# cast and serialize the request data to JSON.
class Request
extend Schema::SchemaFactory
extend Schema::RequestCaster
- extend Schema::JsonDeserializer
+ extend Schema::ResourceCaster
include Schema::SchemaValidator
attr_reader :attributes
def ==(other_resource)
self.attributes == other_resource.attributes
end
+ def to_s
+ self.inspect
+ end
+
protected
def initialize(attributes = {})
- @attributes = self.class.cast(attributes.clone)
- end
-
- def to_s
- self.inspect
+ @attributes = self.class.cast_request(attributes)
end
def schema
self.class.schema
end