Class: PrettyTime::Configuration
- Inherits:
-
Object
- Object
- PrettyTime::Configuration
- Defined in:
- lib/pretty_time/pretty_time.rb
Overview
Configuration Class Defines the suffixes to be used when time in seconds is converted to pretty time.
Example:
PrettyTime.configuration do |config|
config.hours_suffix = 'hrs'
config.minutes_suffix = 'mins'
config.seconds_suffix = 'secs'
end
PrettyTime.load(7805) # Returns 2 hrs 10 mins 5 secs
Default values are:
hours
minutes
seconds
Constant Summary collapse
- DEFAULT_HOURS_SUFFIX =
"hours"
- DEFAULT_MINUTES_SUFFIX =
"minutes"
- DEFAULT_SECONDS_SUFFIX =
"seconds"
Instance Attribute Summary collapse
-
#hours_suffix ⇒ Object
Returns the value of attribute hours_suffix.
-
#minutes_suffix ⇒ Object
Returns the value of attribute minutes_suffix.
-
#seconds_suffix ⇒ Object
Returns the value of attribute seconds_suffix.
Instance Attribute Details
#hours_suffix ⇒ Object
Returns the value of attribute hours_suffix.
113 114 115 |
# File 'lib/pretty_time/pretty_time.rb', line 113 def hours_suffix @hours_suffix end |
#minutes_suffix ⇒ Object
Returns the value of attribute minutes_suffix.
113 114 115 |
# File 'lib/pretty_time/pretty_time.rb', line 113 def minutes_suffix @minutes_suffix end |
#seconds_suffix ⇒ Object
Returns the value of attribute seconds_suffix.
113 114 115 |
# File 'lib/pretty_time/pretty_time.rb', line 113 def seconds_suffix @seconds_suffix end |