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-3.6.0 lib/recurly/request.rb
recurly-3.5.0 lib/recurly/request.rb
recurly-3.4.1 lib/recurly/request.rb
recurly-3.4.0 lib/recurly/request.rb
recurly-3.3.1 lib/recurly/request.rb
recurly-3.3.0 lib/recurly/request.rb
recurly-3.2.2 lib/recurly/request.rb
recurly-3.2.1 lib/recurly/request.rb
recurly-3.2.0 lib/recurly/request.rb
recurly-3.1.3 lib/recurly/request.rb
recurly-3.1.2 lib/recurly/request.rb
recurly-3.1.1 lib/recurly/request.rb
recurly-3.1.0 lib/recurly/request.rb
recurly-3.0.0 lib/recurly/request.rb