Class: XDry::Boxing::DateConverter

Inherits:
Boxer
  • Object
show all
Defined in:
lib/xdry/boxing.rb

Instance Method Summary collapse

Methods inherited from Boxer

#unbox_retained

Instance Method Details

#box(out, data_expr, tempvar_prefix) ⇒ Object



99
100
101
# File 'lib/xdry/boxing.rb', line 99

def box out, data_expr, tempvar_prefix
  SIMPLE_CONVERTIONS['double'].box out, "[#{data_expr} timeIntervalSinceReferenceDate]"
end

#retain_policyObject



108
# File 'lib/xdry/boxing.rb', line 108

def retain_policy; RetainPolicy::RETAIN; end

#unbox(out, object_expr, tempvar_prefix) ⇒ Object



103
104
105
106
# File 'lib/xdry/boxing.rb', line 103

def unbox out, object_expr, tempvar_prefix
  number = SIMPLE_CONVERTIONS['double'].unbox(out, object_expr)
  "[NSDate dateWithTimeIntervalSinceReferenceDate:#{number}]"
end