class Iglu::SchemaKey

Class holding Schema metadata

Public Class Methods

parse_key(key) click to toggle source

Construct SchemaKey from URI

# File lib/iglu-client/core.rb, line 56
def self.parse_key(key)
  vendor, name, format, version = key.scan(URI_REGEX).flatten
  if vendor.nil? or name.nil? or format.nil? or version.nil?
    raise IgluError.new "Schema key [#{key}] is not valid Iglu URI"
  else
    schema_ver = SchemaVer.parse_schemaver(version)
    SchemaKey.new vendor, name, format, schema_ver
  end
end

Public Instance Methods

as_path() click to toggle source

Render as plain path

# File lib/iglu-client/core.rb, line 51
def as_path
  "#{vendor}/#{name}/#{format}/#{version.as_string}"
end
as_uri() click to toggle source

Render as Iglu URI (with `iglu:`)

# File lib/iglu-client/core.rb, line 46
def as_uri
  "iglu:#{as_path}"
end