Skip to content
Tags

,

Getting constants in a class / module ?

June 13, 2011

So I wanted to get some constants defined in the Date class or module. This is what I did:

> Date.constants
 => [:Format, :MONTHNAMES, :DAYNAMES, :ABBR_MONTHNAMES, :ABBR_DAYNAMES, :Infinity, :ITALY, :ENGLAND, :JULIAN, :GREGORIAN, :HALF_DAYS_IN_DAY, :HOURS_IN_DAY, :MINUTES_IN_DAY, :SECONDS_IN_DAY, :MILLISECONDS_IN_DAY, :NANOSECONDS_IN_DAY, :MILLISECONDS_IN_SECOND, :NANOSECONDS_IN_SECOND, :MJD_EPOCH_IN_AJD, :UNIX_EPOCH_IN_AJD, :MJD_EPOCH_IN_CJD, :UNIX_EPOCH_IN_CJD, :LD_EPOCH_IN_CJD, :DATE_FORMATS]
Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: