class CSL::Locale::Date

A localized Date comprises a set of formatting rules for dates.

Attributes

formatting[RW]

Public Class Methods

new(attributes = {}) { |self| ... } click to toggle source
Calls superclass method
# File lib/csl/locale/date.rb, line 13
def initialize(attributes = {})
  super(attributes)
  children[:'date-part'] = []

  yield self if block_given?
end

Public Instance Methods

added_to(node) click to toggle source
# File lib/csl/locale/date.rb, line 20
def added_to(node)
  raise ValidationError, "parent must be locale node: was #{node.inspect}" unless node.is_a?(Locale)
end
delimiter() click to toggle source
# File lib/csl/locale/date.rb, line 24
def delimiter
  attributes.fetch(:delimiter, '')
end
form() click to toggle source
# File lib/csl/locale/date.rb, line 32
def form
  attributes[:form].to_s
end
has_date_parts?() click to toggle source
# File lib/csl/locale/date.rb, line 44
def has_date_parts?
  !date_parts.empty?
end
Also aliased as: has_parts?
has_form?() click to toggle source
# File lib/csl/locale/date.rb, line 28
def has_form?
  attribute?(:form)
end
has_parts?()
Alias for: has_date_parts?
numeric?() click to toggle source
# File lib/csl/locale/date.rb, line 40
def numeric?
  attributes[:form].to_s =~ /^numeric$/i
end
text?() click to toggle source
# File lib/csl/locale/date.rb, line 36
def text?
  !numeric?
end