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.



99
100
101
# File 'lib/grads/command.rb', line 99

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



106
107
108
109
110
111
112
# File 'lib/grads/command.rb', line 106

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.



102
103
104
# File 'lib/grads/command.rb', line 102

def file_id
  @file_id
end

Instance Method Details

#var(name) ⇒ Object



103
104
105
# File 'lib/grads/command.rb', line 103

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