Sha256: 18f54cb40363e65319dcf0aa1c20a2417ed910dcc863410fd7ef597980b85430
Contents?: true
Size: 460 Bytes
Versions: 26
Compression:
Stored size: 460 Bytes
Contents
module VariableHelpers def set(key, value) @_data ||= {} @_data[key] = value end def selected?(key, value = nil) value ? equals?(key, value) : get(key) end def get(key) @_data ||= {} @_data[key] end def equals?(key, value) get(key) == value end def exists?(key) equals?("#{key}_exists".to_sym, true) end private def ensure_variable(key, default_value) set(key, get(key) || default_value) end end
Version data entries
26 entries across 26 versions & 1 rubygems