class Goldfinger::Link

@!attribute [r] href

@return [String] The href the link points to

@!attribute [r] template

@return [String] The template the link contains

@!attribute [r] type

@return [String] The mime type of the link

@!attribute [r] rel

@return [String] The relation descriptor of the link

Attributes

href[R]
rel[R]
template[R]
type[R]

Public Class Methods

new(a) click to toggle source
# File lib/goldfinger/link.rb, line 15
def initialize(a)
  @href       = a[:href]
  @template   = a[:template]
  @type       = a[:type]
  @rel        = a[:rel]
  @titles     = a[:titles]
  @properties = a[:properties]
end

Public Instance Methods

properties() click to toggle source
The "properties" object within the link relation object comprises

zero or more name/value pairs whose names are URIs (referred to as “property identifiers”) and whose values are strings or nil. Properties are used to convey additional information about the link relation. @see property @return [Array] Array form of the hash

# File lib/goldfinger/link.rb, line 40
def properties
  @properties.to_a
end
property(key) click to toggle source

Returns a property for a key @param key [String] @return [String]

# File lib/goldfinger/link.rb, line 54
def property(key)
  @properties[key]
end
title(lang) click to toggle source

Returns a title for a language @param lang [String] @return [String]

# File lib/goldfinger/link.rb, line 47
def title(lang)
  @titles[lang]
end
titles() click to toggle source

The “titles” object comprises zero or more name/value pairs whose names are a language tag or the string “und”. The string is human-readable and describes the link relation. @see title @return [Array] Array form of the hash

# File lib/goldfinger/link.rb, line 29
def titles
  @titles.to_a
end