Sha256: dd851fe6dbda31ccce5f92387247402acd12f84170ecf875120c1752da95a21b
Contents?: true
Size: 618 Bytes
Versions: 3
Compression:
Stored size: 618 Bytes
Contents
class ENVied::Variable attr_reader :name, :type, :group, :default def initialize(name, type, options = {}) @name = name.to_sym @type = type.to_sym @group = options.fetch(:group, :default).to_sym @default = options[:default] #if !@default.is_a? String # raise ArgumentError, "Default values should be strings (variable #{@name})" #end end def default_value(*args) default.respond_to?(:call) ? default[*args] : default end def ==(other) self.class == other.class && [name, type, group, default] == [other.name, other.type, other.group, other.default] end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
envied-0.9.1 | lib/envied/variable.rb |
envied-0.9.0 | lib/envied/variable.rb |
envied-0.8.2 | lib/envied/variable.rb |