Sha256: daa00c04374b35f8032261c154349fb9db0928da51ba6c725aaf67a124b9fef2

Contents?: true

Size: 444 Bytes

Versions: 5

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

module Pleiades
  # Util Modules.
  module Util
    class << self
      def define_reader(hash)
        hash.instance_eval do
          hash.each_pair do |key, val|
            l_val = val.is_a?(Hash) ? Pleiades::Util.define_reader(val) : val
            define_singleton_method(key.to_s.underscore.to_sym) do
              l_val
            end
          end
        end
        hash
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pleiades-0.1.6 lib/pleiades/core/util.rb
pleiades-0.1.5 lib/pleiades/core/util.rb
pleiades-0.1.4 lib/pleiades/core/util.rb
pleiades-0.1.3 lib/pleiades/core/util.rb
pleiades-0.1.2 lib/pleiades/core/util.rb