Sha256: 00bfa790b6ff47c6fdb94ebb9d428b56eda839798680cb4325f7fe3d078d4aa5

Contents?: true

Size: 544 Bytes

Versions: 12

Compression:

Stored size: 544 Bytes

Contents

module Macaroons
  class Caveat
    def initialize(caveat_id, verification_id=nil, caveat_location=nil)
      @caveat_id = caveat_id
      @verification_id = verification_id
      @caveat_location = caveat_location
    end

    attr_accessor :caveat_id
    attr_accessor :verification_id
    attr_accessor :caveat_location

    def first_party?
      verification_id.nil?
    end

    def third_party?
      !first_party?
    end

    def to_h
      {'cid' => @caveat_id, 'vid' => @verification_id, 'cl' => @caveat_location}
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
macaroons-1.0.0 lib/macaroons/caveat.rb
macaroons-0.7.1 lib/macaroons/caveat.rb
macaroons-0.7.0 lib/macaroons/caveat.rb
macaroons-0.6.3 lib/macaroons/caveat.rb
macaroons-0.6.2 lib/macaroons/caveat.rb
macaroons-0.6.1 lib/macaroons/caveat.rb
macaroons-0.6.0 lib/macaroons/caveat.rb
macaroons-0.5.3 lib/macaroons/caveat.rb
macaroons-0.5.2 lib/macaroons/caveat.rb
macaroons-0.5.1 lib/macaroons/caveat.rb
macaroons-0.4.1 lib/macaroons/caveat.rb
macaroons-0.4.0 lib/macaroons/caveat.rb