Sha256: 738dafcb2b4819795b1d17d6cbeaa7418af47ea134d90334f75a75ff15d5efba

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

module CSL
  class Style

    class Bibliography < Node

      include InheritableNameOptions

      attr_struct :'subsequent-author-substitute',
        :'subsequent-author-substitute-rule',
        *Schema.attr(:bibliography, :name, :names)

      attr_children :sort, :layout

      attr_defaults :'line-spacing' => 1, :'entry-spacing' => 1,
        :'subsequent-author-substitute-rule' => 'complete-all'

      alias sort? has_sort?

      def bibliography_options
        attributes_for(*Schema.attr(:bibliography))
      end

      def sort_keys
        return [] unless sort?
        children[:sort].descendants
      end

      def substitute_subsequent_authors?
        attribute?(:'subsequent-author-substitute')
      end

      def subsequent_author_substitute
        attributes[:'subsequent-author-substitute'].to_s
      end

      def subsequent_author_substitute_rule
        attributes[:'subsequent-author-substitute-rule'].to_s
      end

      def substitute_subsequent_authors_completely?
        return false unless substitute_subsequent_authors?
        subsequent_author_substitute_rule == 'complete-all'
      end

      def substitute_subsequent_authors_individually?
        return false unless substitute_subsequent_authors?
        subsequent_author_substitute_rule != 'complete-all'
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csl-1.1.0 lib/csl/style/bibliography.rb