Sha256: 5b96be7181c7f2234f07093f45d097c78d46ac30679c2ff27d342473d16e451e

Contents?: true

Size: 376 Bytes

Versions: 1

Compression:

Stored size: 376 Bytes

Contents

module SettingsJs
  module Adapters
    class SettingsLogic

      attr_accessor :klass

      def initialize(klass)
        self.klass = klass
      end

      def to_hash(base_key)
        keys      = base_key.split(/\./)
        base_hash = klass.send(keys.shift)

        keys.each { |key| base_hash = base_hash.send(key) }

        base_hash
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
settings_js-0.0.1 lib/settings_js/adapters/settings_logic.rb