Sha256: 6e2d531fb16ef43a7c5ca35a992bb73ec93a7887db1ec89b0439b58a45ab20d0

Contents?: true

Size: 633 Bytes

Versions: 4

Compression:

Stored size: 633 Bytes

Contents

module Arx

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

    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

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

    inspector :name, :affiliated?, :affiliations
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arx-1.1.0 lib/arx/entities/author.rb
arx-1.0.1 lib/arx/entities/author.rb
arx-1.0.0 lib/arx/entities/author.rb
arx-0.3.2 lib/arx/entities/author.rb