Sha256: 74fc84474b11c66c21233bd17d622e5bfd65b557124edc045e9ddb9f2b239d65

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 Bytes

Contents

#
# component.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

module ConstantContact
	module Components
		class Component
			protected

			# Get the requested value from a hash, or return the default
			# @param [Hash] hsh - the hash to search for the provided hash key
			# @param [String] key - hash key to look for
			# @param [String] default - value to return if the key is not found, default is null
			# @return [String]
			def self.get_value(hsh, key, default = nil)
				hsh.has_key?(key) and hsh[key] ? hsh[key] : default
			end

		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
constantcontact-1.0.0 lib/constantcontact/components/component.rb