Class: Lotus::Link
- Inherits:
-
Object
- Object
- Lotus::Link
- Defined in:
- lib/lotus/link.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
The URL for the related resource.
-
#hreflang ⇒ Object
readonly
Advises to the language of the linked resource.
-
#length ⇒ Object
readonly
Advises the length of the linked content in number of bytes.
-
#rel ⇒ Object
readonly
A string indicating the relationship type with the current document.
-
#title ⇒ Object
readonly
Conveys human-readable information about the linked resource.
-
#type ⇒ Object
readonly
Advises to the content MIME type of the linked resource.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Link
constructor
A new instance of Link.
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( = {}) @href = [:href] @rel = [:rel] @type = [:type] @hreflang = [:hreflang] @title = [:title] @length = [:length] end |
Instance Attribute Details
#href ⇒ Object (readonly)
The URL for the related resource.
6 7 8 |
# File 'lib/lotus/link.rb', line 6 def href @href end |
#hreflang ⇒ Object (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 |
#length ⇒ Object (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 |
#rel ⇒ Object (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 |
#title ⇒ Object (readonly)
Conveys human-readable information about the linked resource.
40 41 42 |
# File 'lib/lotus/link.rb', line 40 def title @title end |
#type ⇒ Object (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 |