Sha256: 510c93a11185ec4f3b79894a994e72c0013622b030aea394d135d3cdfd693686

Contents?: true

Size: 556 Bytes

Versions: 13

Compression:

Stored size: 556 Bytes

Contents

class Time

  # Like change but does not reset earlier times.
  #
  # NOTE: It would be better, probably if this were called "change".
  #       and that #change were called "reset".
  #
  def set(options)
    opts={}; options.each_pair{ |k,v| opts[k] = v.to_i }
    self.class.send( self.utc? ? :utc : :local,
      opts[:year]  || self.year,
      opts[:month] || self.month,
      opts[:day]   || self.day,
      opts[:hour]  || self.hour,
      opts[:min]   || self.min,
      opts[:sec]   || self.sec,
      opts[:usec]  || self.usec
    )
  end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
facets-2.8.4 lib/core/facets/time/set.rb
facets-2.8.3 lib/core/facets/time/set.rb
facets-2.8.2 lib/core/facets/time/set.rb
facets-2.8.1 lib/core/facets/time/set.rb
facets-2.8.0 lib/core/facets/time/set.rb
facets-2.7.0 lib/core/facets/time/set.rb
facets-2.6.0 lib/core/facets/time/set.rb
facets-2.4.4 lib/core/facets/time/set.rb
facets-2.5.1 lib/core/facets/time/set.rb
facets-2.5.0 lib/core/facets/time/set.rb
facets-2.4.5 lib/core/facets/time/set.rb
facets-2.5.2 lib/core/facets/time/set.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/time/set.rb