Class: Bio::Ucsc::Schema::Variables

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-ucsc/schema.rb

Overview

class Joiner

Instance Method Summary collapse

Constructor Details

#initializeVariables

Returns a new instance of Variables.



240
241
242
# File 'lib/bio-ucsc/schema.rb', line 240

def initialize
  @var = Hash.new
end

Instance Method Details

#[](key) ⇒ Object



253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/bio-ucsc/schema.rb', line 253

def [](key)
  if @var[key].nil?

  end

  return @var[key].map do |v|
    if v.start_with?("$")
      self[(v[1..-1])]
    else
      v
    end
  end
end

#[]=(key, value) ⇒ Object



244
245
246
247
248
249
250
251
# File 'lib/bio-ucsc/schema.rb', line 244

def []=(key, value)
  if value.respond_to?(:each)
    @var[key] = value            
  else
    @var[key] = [value]
  end
  @var[key]
end