Sha256: 0e7f31a279e4568f8e42d21f00b86deae4d35fc7810b3138b8c60a6fce1dc0df

Contents?: true

Size: 637 Bytes

Versions: 3

Compression:

Stored size: 637 Bytes

Contents

require 'happymapper'
require 'arx/cleaner'

module Arx

  # Entity/model representing an arXiv paper's author.
  class Author
    include HappyMapper

    tag 'author'

    # @!method name
    # The name of the author.
    # @return [String]
    element :name, Cleaner, tag: 'name', parser: :clean

    # @!method affiliations
    # The author's affiliations.
    # @return [Array<String>]
    has_many :affiliations, Cleaner, tag: 'affiliation', parser: :clean

    # @!method affiliations?
    # Whether or not the author has any affiliations.
    # @return [Boolean]
    def affiliations?
      !affiliations.empty?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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