Sha256: ffbbdf46966d51dcb42c416646bc555801c827b7267c2e152e988dbb5ee09aee

Contents?: true

Size: 902 Bytes

Versions: 10

Compression:

Stored size: 902 Bytes

Contents

module Stellar
  module Horizon
    class Problem 
      include Contracts

      def initialize(attributes)
        @attributes = attributes.reverse_merge({
          type: "about:blank",
          title: "Unknown Error",
          status: 500,
        })

        @meta = @attributes.except!(:type, :title, :status, :detail, :instance)
      end

      Contract None => String
      def type
        @attributes[:type] 
      end

      Contract None => String
      def title
        @attributes[:title] 
      end

      Contract None => Num
      def status
        @attributes[:status] 
      end

      Contract None => String
      def detail
        @attributes[:detail] 
      end

      Contract None => String
      def instance
        @attributes[:instance] 
      end

      Contract None => HashOf[String, Any]
      def meta
        @attributes[:instance] 
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
stellar-sdk-0.8.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.7.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.6.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.5.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.4.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.3.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.2.0 lib/stellar/horizon/problem.rb
stellar-sdk-0.1.1 lib/stellar/horizon/problem.rb
stellar-sdk-0.1.0 lib/stellar/horizon/problem.rb
stellar-lib-0.0.2 lib/stellar/horizon/problem.rb