class Bricolage::Variable

Attributes

name[R]
value[R]

Public Class Methods

expand_string(str) { |$1 || $2| ... } click to toggle source

generic variable extractor

# File lib/bricolage/variables.rb, line 182
def Variable.expand_string(str)
  str.gsub(/\$(\w+)|\$\{(\w+)\}/) { yield ($1 || $2) }
end
list(str) click to toggle source
# File lib/bricolage/variables.rb, line 186
def Variable.list(str)
  str.scan(/\$(\w+)|\$\{(\w+)\}/).flatten.compact.uniq
end
new(name, value) click to toggle source
# File lib/bricolage/variables.rb, line 190
def initialize(name, value)
  @name = name
  @value = value
end

Public Instance Methods

inspect() click to toggle source
# File lib/bricolage/variables.rb, line 202
def inspect
  "\#<#{self.class} #{@name}=#{@value.inspect}>"
end
resolved?() click to toggle source
# File lib/bricolage/variables.rb, line 198
def resolved?
  false
end