Sha256: 6a4cd2b28db873fee6ad7612989389a7184cb8d5f9879d08856d3b3a65ece796

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 Bytes

Contents

module CSL
  class Style
    
    class Number < Node
      attr_struct :variable, :form, :'text-case',
        *Schema.attr(:affixes, :display, :font)
      

      # @return [Boolean] whether or not the number's format is set to
      #   :numeric; also returns true if the number's form attribute is not
      #   set or nil.
      def numeric?
        !attribute?(:form) || attributes.form.to_sym == :numeric
      end

      # @return [Boolean] whether or not the number's format is set to :ordinal
      def ordinal?
        attribute?(:form) && attributes.form.to_sym == :ordinal
      end
      
      # @return [Boolean] whether or not the number's format is set to :'long-ordinal'
      def long_ordinal?
        attribute?(:form) && attributes.form.to_sym == :'long-ordinal'
      end
      
      # @return [Boolean] whether or not the number's format is set to :roman
      def roman?
        attribute?(:form) && attributes.form.to_sym == :roman
      end
            
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
csl-1.0.0.pre5 lib/csl/style/number.rb
csl-1.0.0.pre4 lib/csl/style/number.rb
csl-1.0.0.pre3 lib/csl/style/number.rb
csl-1.0.0.pre2 lib/csl/style/number.rb