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

Version Path
modalh-1.1.9 lib/h/helpers.rb
modalh-1.1.8 lib/h/helpers.rb
modalh-1.1.7 lib/h/helpers.rb
modalh-1.1.6 lib/h/helpers.rb
modalh-1.1.5 lib/h/helpers.rb
modalh-1.1.4 lib/h/helpers.rb
modalh-1.1.3 lib/h/helpers.rb
modalh-1.1.2 lib/h/helpers.rb
modalh-1.1.1 lib/h/helpers.rb