CLLocationManager.alloc.init @location_manager.delegate = self @location_manager.startUpdatingLocation end def locationManager(manager, didUpdateToLocation:new, fromLocation:old) @callback.call to: newLocation, from: oldLocation end end
value when NSArray value.reduce { |i, j| const_int_get(base, i) | const_int_get(base, j) } else value = value.to_s.camelize Kernel.const_get("#{base}#{value}") end end end github.com/clayallsopp/inspect-2013
(PUDIBT class AppDelegate private def constants_hack [UIViewAutoresizingFlexibleHeight, UIViewAutoresizingFlexibleWidth, UIViewAutoresizingFlexibleTopMargin, etc] end end
@http_client = http_client end def []=(header, value) @http_client.setDefaultHeader(header, value: value) end end def headers @header_dsl ||= HeaderDSL.new(self) end end