method

emit

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: Date
emit(e, f) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/date/format.rb, line 139
  def emit(e, f) # :nodoc:
    case e
    when Numeric
      sign = %w(+ + -)[e <=> 0]
      e = e.abs
    end

    s = e.to_s

    if f[:s] && f[:p] == '0'
      f[:w] -= 1
    end

    if f[:s] && f[:p] == "\s"
      s[0,0] = sign
    end

    if f[:p] != '-'
      s = s.rjust(f[:w], f[:p])
    end

    if f[:s] && f[:p] != "\s"
      s[0,0] = sign
    end

    s = s.upcase if f[:u]
    s = s.downcase if f[:d]
    s
  end
Register or log in to add new notes.