Class: XDry::Boxing::NSNumberConverter
- Defined in:
- lib/xdry/boxing.rb
Instance Method Summary collapse
- #box(out, data_expr, tempvar_prefix) ⇒ Object
-
#initialize(repr_selector, init_selector) ⇒ NSNumberConverter
constructor
A new instance of NSNumberConverter.
- #retain_policy ⇒ Object
- #unbox(out, object_expr, tempvar_prefix) ⇒ Object
Methods inherited from Boxer
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_policy ⇒ Object
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 |