Class: BerkeleyLibrary::AV::Metadata::Link
- Inherits:
-
Object
- Object
- BerkeleyLibrary::AV::Metadata::Link
- Includes:
- Comparable
- Defined in:
- lib/berkeley_library/av/metadata/link.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(body:, url:) ⇒ Link
constructor
A new instance of Link.
- #to_s ⇒ Object
Constructor Details
#initialize(body:, url:) ⇒ Link
Returns a new instance of Link.
9 10 11 12 |
# File 'lib/berkeley_library/av/metadata/link.rb', line 9 def initialize(body:, url:) @body = body @url = url end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/berkeley_library/av/metadata/link.rb', line 7 def body @body end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/berkeley_library/av/metadata/link.rb', line 7 def url @url end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/berkeley_library/av/metadata/link.rb', line 18 def <=>(other) return unless other return 0 if equal?(other) return unless other.is_a?(Link) to_s <=> other.to_s end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/berkeley_library/av/metadata/link.rb', line 14 def to_s "[#{body}](#{url})" end |