Sha256: 13117184b639a69e5791614c5de559836266dccd4884de57c9bb3dfc608604a4

Contents?: true

Size: 596 Bytes

Versions: 4

Compression:

Stored size: 596 Bytes

Contents

module TarvitHelpers
  module HashPresenter
    require_relative '../modules/hash_presenter/simple'
    require_relative '../modules/hash_presenter/cached'
    require_relative '../modules/hash_presenter/observable'
    require_relative '../modules/hash_presenter/with_rules'
    require_relative '../modules/hash_presenter/custom'

    def self.present(hash, option = :cached )
      raise ArgumentError.new("#{ hash.class } is not a Hash") unless hash.is_a?(Hash)
      factory[option].new(hash)
    end

    def self.factory
      { cached: Cached, observable: Observable }
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tarvit-helpers-0.0.23 lib/tarvit-helpers/modules/hash_presenter.rb
tarvit-helpers-0.0.22 lib/tarvit-helpers/modules/hash_presenter.rb
tarvit-helpers-0.0.21 lib/tarvit-helpers/modules/hash_presenter.rb
tarvit-helpers-0.0.20 lib/tarvit-helpers/modules/hash_presenter.rb