Sha256: 74837aee819b94b2ec788f6eaf86aa9627f60ebdaf8270ef254e69daf3caebf4
Contents?: true
Size: 388 Bytes
Versions: 5
Compression:
Stored size: 388 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}<<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
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
modalh-1.0.5 | lib/h/helpers.rb |
modalh-1.0.4 | lib/h/helpers.rb |
modalh-1.0.3 | lib/h/helpers.rb |
modalh-1.0.1 | lib/h/helpers.rb |
modalh-1.0.0 | lib/h/helpers.rb |