Sha256: 9c3ef2e684b9e88448c7fed254837841fed91d98924ccb07c4767a1f41813a73

Contents?: true

Size: 646 Bytes

Versions: 94

Compression:

Stored size: 646 Bytes

Contents

module Recurly
  # This class represents a request to Recurly.
  # 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::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_request(attributes)
    end

    def schema
      self.class.schema
    end
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
recurly-4.56.0 lib/recurly/request.rb
recurly-4.55.0 lib/recurly/request.rb
recurly-4.54.0 lib/recurly/request.rb
recurly-4.53.0 lib/recurly/request.rb
recurly-4.52.0 lib/recurly/request.rb
recurly-4.49.0 lib/recurly/request.rb
recurly-4.48.1 lib/recurly/request.rb
recurly-4.48.0 lib/recurly/request.rb
recurly-4.47.0 lib/recurly/request.rb
recurly-4.46.0 lib/recurly/request.rb
recurly-4.45.0 lib/recurly/request.rb
recurly-4.44.0 lib/recurly/request.rb
recurly-4.43.0 lib/recurly/request.rb
recurly-4.42.0 lib/recurly/request.rb
recurly-4.41.0 lib/recurly/request.rb
recurly-4.40.0 lib/recurly/request.rb
recurly-4.39.0 lib/recurly/request.rb
recurly-4.38.0 lib/recurly/request.rb
recurly-4.37.0 lib/recurly/request.rb
recurly-3.28.0 lib/recurly/request.rb