Module: DataModule::WithKey

Defined in:
lib/rbbt/util/data_module.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/rbbt/util/data_module.rb', line 61

def method_missing(name, *args)
  if key
    klass.send(name, key, *args)
  else
    klass.send(name, *args)
  end
end

Instance Method Details

#keyObject



57
58
59
# File 'lib/rbbt/util/data_module.rb', line 57

def key
  @key
end

#key=(key) ⇒ Object



53
54
55
# File 'lib/rbbt/util/data_module.rb', line 53

def key=(key)
  @key = key
end

#klassObject



49
50
51
# File 'lib/rbbt/util/data_module.rb', line 49

def klass
  @klass
end

#klass=(klass) ⇒ Object



45
46
47
# File 'lib/rbbt/util/data_module.rb', line 45

def klass=(klass)
  @klass = klass
end