### Home Classes Methods

### In Files

- lib/stella/core_ext.rb

### Methods

- #'μs'
- #day
- #days
- #hour
- #hours
- #in_days
- #in_hours
- #in_microseconds
- #in_milliseconds
- #in_minutes
- #in_seconds
- #in_time
- #in_weeks
- #in_years
- #microseconds
- #milliseconds
- #minute
- #minutes
- #ms
- #second
- #seconds
- #week
- #weeks
- #year
- #years

### Files

- LICENSE.txt
- TODO

### Class/Module Index

Quicksearch

- Stella
- Stella::API
- Stella::API::Unauthorized
- Stella::Asserts
- Stella::CLI
- Stella::Client
- Stella::Common
- Stella::Common::PrivacyMethods
- Stella::ET
- Stella::Engine
- Stella::Engine::Base
- Stella::Engine::Base::ClassMethods
- Stella::Engine::Checkup
- Stella::EventTemplate
- Stella::ForcedRedirect
- Stella::HTTPError
- Stella::Log
- Stella::Log::HTTP
- Stella::PageError
- Stella::RT
- Stella::RepeatRequest
- Stella::Report
- Stella::Report::Content
- Stella::Report::Content::ReportMethods
- Stella::Report::Errors
- Stella::Report::Errors::ReportMethods
- Stella::Report::Headers
- Stella::Report::Metrics
- Stella::Report::Metrics::ReportMethods
- Stella::Report::Plugin
- Stella::Report::Plugin::ClassMethods
- Stella::Report::Statuses
- Stella::Report::Statuses::ReportMethods
- Stella::RequestError
- Stella::RequestTemplate
- Stella::Session
- Stella::StringTemplate
- Stella::TP
- Stella::Testplan
- Stella::Testplan::ClassMethods
- Stella::TestplanQuit
- Stella::Testrun
- Stella::TimeoutError
- Stella::UC
- Stella::Usecase
- Stella::Usecase::ClassMethods
- Stella::UsecaseError
- Stella::UsecaseFail
- Stella::Utils
- Stella::VERSION
- Addressable
- Addressable::URI
- Time
- Time::Units
- Array
- DefaultTestplan
- Float
- Hash
- MatchData
- MetricsPack
- Numeric
- Object
- OpenStruct
- StellaBehavior
- StellaError
- String
- Symbol
- Thread

No matching classes.

# Time::Units

### Constants

PER_DAY
PER_HOUR
PER_MICROSECOND
PER_MILLISECOND
PER_MINUTE

### Public Instance Methods

'μs'() click to toggle source
Alias for: microseconds
day() click to toggle source
Alias for: days
days() click to toggle source

    # File lib/stella/core_ext.rb, line 186
    def days()            seconds * PER_DAY               end

Also aliased as: day
hour() click to toggle source
Alias for: hours
hours() click to toggle source

    # File lib/stella/core_ext.rb, line 185
    def hours()           seconds * PER_HOUR             end

Also aliased as: hour
in_days() click to toggle source

    # File lib/stella/core_ext.rb, line 192
    def in_days()         seconds / PER_DAY          end

in_hours() click to toggle source

    # File lib/stella/core_ext.rb, line 193
    def in_hours()        seconds / PER_HOUR          end

in_microseconds() click to toggle source

    # File lib/stella/core_ext.rb, line 196
    def in_microseconds() seconds / PER_MICROSECOND   end

in_milliseconds() click to toggle source

    # File lib/stella/core_ext.rb, line 195
    def in_milliseconds() seconds / PER_MILLISECOND    end

in_minutes() click to toggle source

    # File lib/stella/core_ext.rb, line 194
    def in_minutes()      seconds / PER_MINUTE         end

in_seconds(u=nil) click to toggle source

    # File lib/stella/core_ext.rb, line 202
    def in_seconds(u=nil)
      case u.to_s
      when /\A(y)|(years?)\z/
        years
      when /\A(w)|(weeks?)\z/
        weeks
      when /\A(d)|(days?)\z/
        days
      when /\A(h)|(hours?)\z/
        hours
      when /\A(m)|(minutes?)\z/
        minutes
      when /\A(ms)|(milliseconds?)\z/
        milliseconds
      when /\A(us)|(microseconds?)|(μs)\z/
        microseconds
      else
        self
      end
    end

in_time() click to toggle source

    # File lib/stella/core_ext.rb, line 198
    def in_time
      Time.at(self).utc
    end

in_weeks() click to toggle source

    # File lib/stella/core_ext.rb, line 191
    def in_weeks()        seconds / PER_DAY / 7       end

in_years() click to toggle source

    # File lib/stella/core_ext.rb, line 190
    def in_years()        seconds / PER_DAY / 365      end

microseconds() click to toggle source

    # File lib/stella/core_ext.rb, line 181
    def microseconds()    seconds * PER_MICROSECOND     end

Also aliased as: 'μs'
milliseconds() click to toggle source

    # File lib/stella/core_ext.rb, line 182
    def milliseconds()    seconds * PER_MILLISECOND    end

Also aliased as: ms
minute() click to toggle source
Alias for: minutes
minutes() click to toggle source

    # File lib/stella/core_ext.rb, line 184
    def minutes()         seconds * PER_MINUTE          end

Also aliased as: minute
ms() click to toggle source

    JRuby doesn't like using instance_methods.select here.
    It could be a bug or something quirky with Attic
    (although it works in 1.8 and 1.9). The error:

     lib/attic.rb:32:in `select': yield called out of block (LocalJumpError)
     lib/stella/mixins/numeric.rb:24

    Create singular methods, like hour and day.

instance_methods.select.each do |plural|

    singular = plural.to_s.chop
    alias_method singular, plural

end

Alias for: milliseconds
second() click to toggle source
Alias for: seconds
seconds() click to toggle source

    # File lib/stella/core_ext.rb, line 183
    def seconds()         self                         end

Also aliased as: second
week() click to toggle source
Alias for: weeks
weeks() click to toggle source

    # File lib/stella/core_ext.rb, line 187
    def weeks()           seconds * PER_DAY * 7           end

Also aliased as: week
year() click to toggle source
Alias for: years
years() click to toggle source

    # File lib/stella/core_ext.rb, line 188
    def years()           seconds * PER_DAY * 365        end

Also aliased as: year

[Validate]

Generated with the Darkfish Rdoc Generator 2.