Sha256: 2275301bafbe9505e477be867b083e3c4d3aecd43d6d409d2b6f9cfd7101ab06

Contents?: true

Size: 979 Bytes

Versions: 1

Compression:

Stored size: 979 Bytes

Contents

module CSL
  class Style
    
    class Number < Node
      attr_struct :form, *Schema.attr(:affixes, :display, :font, :textcase)
      

      # @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

1 entries across 1 versions & 1 rubygems

Version Path
csl-1.0.0.pre1 lib/csl/style/number.rb