Class: Lotus::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Link

Returns a new instance of Link.



47
48
49
50
51
52
53
54
# File 'lib/lotus/link.rb', line 47

def initialize(options = {})
  @href     = options[:href]
  @rel      = options[:rel]
  @type     = options[:type]
  @hreflang = options[:hreflang]
  @title    = options[:title]
  @length   = options[:length]
end

Instance Attribute Details

#hrefObject (readonly)

The URL for the related resource.



6
7
8
# File 'lib/lotus/link.rb', line 6

def href
  @href
end

#hreflangObject (readonly)

Advises to the language of the linked resource. When used with rel=“alternate” it depicts a translated version of the entry. Use with a RFC3066 language tag.



37
38
39
# File 'lib/lotus/link.rb', line 37

def hreflang
  @hreflang
end

#lengthObject (readonly)

Advises the length of the linked content in number of bytes. It is simply a hint about the length based upon prior information. It may change, and cannot override the actual content length.



45
46
47
# File 'lib/lotus/link.rb', line 45

def length
  @length
end

#relObject (readonly)

A string indicating the relationship type with the current document.

Standard:

"alternate" = Signifies that the URL in href identifies an alternative
              version of the resource described by the containing
              element.
"related"   = Signifies that the URL in href identifies a resource that
              is related to the contained resource. For example, the
              feed for a site that discusses the performance of the
              search engine at "http://search.example.com" might
              contain, as a link of Feed, a related link to that
              "http://search.example.com".
"self"      = Signifies that href contains a URL to the containing
              resource.
"enclosure" = Signifies that the URL in href identifies a related
              resource that is potentially large in size and
              require special handling. SHOULD use the length field.
"via"       = Signifies that the URL in href identifies a resource that
              is the source of the information provided in the
              containing element.


29
30
31
# File 'lib/lotus/link.rb', line 29

def rel
  @rel
end

#titleObject (readonly)

Conveys human-readable information about the linked resource.



40
41
42
# File 'lib/lotus/link.rb', line 40

def title
  @title
end

#typeObject (readonly)

Advises to the content MIME type of the linked resource.



32
33
34
# File 'lib/lotus/link.rb', line 32

def type
  @type
end