lib/arx/entities/link.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Arx

  # Helper entity/model representing a link on an arXiv paper.
  #
  # @private
  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