Class: ActionSet::Instruction::Value::TimeWithZoneAdapter
- Inherits:
-
Object
- Object
- ActionSet::Instruction::Value::TimeWithZoneAdapter
- Defined in:
- lib/action_set/instruction/value.rb
Instance Method Summary collapse
-
#initialize(raw, target) ⇒ TimeWithZoneAdapter
constructor
A new instance of TimeWithZoneAdapter.
- #process ⇒ Object
Constructor Details
#initialize(raw, target) ⇒ TimeWithZoneAdapter
Returns a new instance of TimeWithZoneAdapter.
137 138 139 140 |
# File 'lib/action_set/instruction/value.rb', line 137 def initialize(raw, target) @raw = raw @target = target end |
Instance Method Details
#process ⇒ Object
142 143 144 145 146 147 148 149 150 |
# File 'lib/action_set/instruction/value.rb', line 142 def process return if @raw.is_a? @target return unless @target.eql?(ActiveSupport::TimeWithZone) time_value = ActiveModelAdapter.new(@raw, Time).process return unless time_value.is_a?(Time) return time_value unless time_value.respond_to?(:in_time_zone) time_value.in_time_zone end |