Sha256: 6dbe9ed127ec5bb3d6b907377bc7048aff609049ef36b428818c456d4854e88f

Contents?: true

Size: 399 Bytes

Versions: 3

Compression:

Stored size: 399 Bytes

Contents

require 'happymapper'

module Arx

  # Helper entity/model representing a link on an arXiv paper.
  class Link
    include HappyMapper

    tag 'link'

    attribute :title, String
    attribute :rel,   String
    attribute :type,  String
    attribute :href,  String

    %w[pdf doi].each do |link_type|
      define_method "#{link_type}?" do
        @title == link_type
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arx-0.3.0 lib/arx/entities/link.rb
arx-0.2.0 lib/arx/entities/link.rb
arx-0.1.0 lib/arx/entities/link.rb