Class: GrADS::Command::DataHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/grads/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_id) ⇒ DataHandler

Returns a new instance of DataHandler.



92
93
94
# File 'lib/grads/command.rb', line 92

def initialize (file_id)
  @file_id = file_id
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *argv) ⇒ Object



99
100
101
102
103
104
105
# File 'lib/grads/command.rb', line 99

def method_missing (id, *argv)
  if argv.empty?
    return Variable.new(@file_id, id.to_s)
  else
    super
  end
end

Instance Attribute Details

#file_idObject (readonly)

Returns the value of attribute file_id.



95
96
97
# File 'lib/grads/command.rb', line 95

def file_id
  @file_id
end

Instance Method Details

#var(name) ⇒ Object



96
97
98
# File 'lib/grads/command.rb', line 96

def var (name)
  return Variable.new(@file_id, name)
end