Sha256: f47b2ae5521961bec56e4ea1220bc7104b3c65ab4112753e486a59b57eeab60a

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 Bytes

Contents

module BerkeleyLibrary
  module AV
    class Metadata
      class Link
        include Comparable

        attr_reader :body, :url

        def initialize(body:, url:)
          @body = body
          @url = url
        end

        def to_s
          "[#{body}](#{url})"
        end

        def <=>(other)
          return unless other
          return 0 if equal?(other)
          return unless other.is_a?(Link)

          to_s <=> other.to_s
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
berkeley_library-av-core-0.4.2 lib/berkeley_library/av/metadata/link.rb
berkeley_library-av-core-0.4.1 lib/berkeley_library/av/metadata/link.rb
berkeley_library-av-core-0.4.0 lib/berkeley_library/av/metadata/link.rb