Class: Bio::Ucsc::Schema::Variables
- Inherits:
-
Object
- Object
- Bio::Ucsc::Schema::Variables
- Defined in:
- lib/bio-ucsc/schema.rb
Overview
class Joiner
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Variables
constructor
A new instance of Variables.
Constructor Details
#initialize ⇒ Variables
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 |