Sha256: ca1872ae8c13cfb391f16a2bd49e2cdda49d9d204e7b912498158585c7648521
Contents?: true
Size: 392 Bytes
Versions: 9
Compression:
Stored size: 392 Bytes
Contents
module H # Define methods to_h for H.to, from_h from H.from, xxx_to_h from H.xxx_to, xxx_from_h from H.xxx_from module Helpers (%w{date number integer logical magnitude dms}<<nil).each do |type| %w{from to}.each do |kind| name = [type,kind].compact*'_' define_method "#{name}_h" do |*args| H.send name, *args end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems