Method: When::TM::DateAndTime#_copy

Defined in:
lib/when_exe/tmptypes.rb

#_copy(options = {}) ⇒ Object

属性のコピー



1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'lib/when_exe/tmptypes.rb', line 1143

def _copy(options={})
  # 夏時間の調整
  case options[:time]
  when Array
    if clock._need_validate
      if @calendar_era_props
        date     = options[:date].dup
        date[0] += calendar_era_epoch
      else
        date     = options[:date]
      end
      new_clock = clock._daylight([@frame, date, options[:time]])
      options[:time] = options[:time].map {|t| t * 1}
    else
      new_clock = clock
    end
    options[:time] = @clk_time.dup._copy(options.merge({:clock=>new_clock}))
  when nil
    options[:time] = @clk_time.dup._copy(options)
  end

  return super(options)
end