Sha256: 769f1746d1e7a8d543645714885a6f1dedb3b7bf9e4e26af60ea6aac31b7ae1d

Contents?: true

Size: 547 Bytes

Versions: 4

Compression:

Stored size: 547 Bytes

Contents

module SmartMonth
  # Responsible for odds and ends.
  module Util
    # returns the month as a string.
    def inspect
     "#{self.to_s}"
    end
    
    # returns the year of the current month.
    def year
      @date.year
    end
    
    # returns the month and the year as a string.
    def inspect!
      "#{self.to_s} #{@date.year}"
    end

    # returns the month as a string.
    def to_s
       Month::NAMES[@date.month]
    end

    # returns the month as a fixnum.
    def to_i
      Month::NAMES.index(self.to_s)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rmoriz-smartmonth-1.0.2 lib/smart_month/util.rb
rmoriz-smartmonth-1.0 lib/smart_month/util.rb
rmoriz-smartmonth-1.01 lib/smart_month/util.rb
rmoriz-smartmonth-1.1.1 lib/smart_month/util.rb