Sha256: 709c97f9c05b4a96a029e82424029573abac767ad5a6d5b8b2e59743e34a0631

Contents?: true

Size: 399 Bytes

Versions: 4

Compression:

Stored size: 399 Bytes

Contents

module Yaks
  class RelRegistry
  end

  class TemplateRelRegistry < RelRegistry
    def initialize(template)
      @template = URITemplate.new(template)
    end

    def lookup(source, destination)
      @template.expand(:src => source, :dest => destination)
    end
  end

  class NullRelRegistry < TemplateRelRegistry
    def initialize
      super('rel:src={src}&dest={dest}')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yaks-0.3.1 lib/yaks/rel_registry.rb
yaks-0.3.0 lib/yaks/rel_registry.rb
yaks-0.2.0 lib/yaks/rel_registry.rb
yaks-0.1.0 lib/yaks/rel_registry.rb