Sha256: c707f446cd6a0c4c93aac1a5e1cc0426ba586ab450faa3057d270c7df95608bc
Contents?: true
Size: 692 Bytes
Versions: 5
Compression:
Stored size: 692 Bytes
Contents
module PayPal module Recurring module Utils def convert_to_time(string) DateTime.strptime(string, "%H:%M:%S %b %e, %Y %Z").new_offset(0) end def mapping(options = {}) options.each do |to, from| class_eval <<-RUBY def #{to} @#{to} ||= begin from = [#{from.inspect}].flatten name = from.find {|name| params[name]} value = nil value = params[name] if name value = send("build_#{to}", value) if respond_to?("build_#{to}", true) value end end RUBY end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems