Class: XDry::Boxing::NSNumberConverter

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

Instance Method Summary collapse

Methods inherited from Boxer

#unbox_retained

Constructor Details

#initialize(repr_selector, init_selector) ⇒ NSNumberConverter

Returns a new instance of NSNumberConverter.



82
83
84
85
# File 'lib/xdry/boxing.rb', line 82

def initialize repr_selector, init_selector
  @init_selector = init_selector
  @repr_selector = repr_selector
end

Instance Method Details

#box(out, data_expr, tempvar_prefix) ⇒ Object



87
88
89
# File 'lib/xdry/boxing.rb', line 87

def box out, data_expr, tempvar_prefix
  "[NSNumber #{@init_selector}:#{data_expr}]"
end

#retain_policyObject



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

def retain_policy; RetainPolicy::ASSIGN_VALUE; end

#unbox(out, object_expr, tempvar_prefix) ⇒ Object



91
92
93
# File 'lib/xdry/boxing.rb', line 91

def unbox out, object_expr, tempvar_prefix
  "[#{object_expr} #{@repr_selector}]"
end