Module: Aliyun::Odps::Modelable

Included in:
Client, Function, Instance, Project, Resource, Table
Defined in:
lib/aliyun/odps/modelable.rb

Instance Method Summary collapse

Instance Method Details

#has_many(models, _opts = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/aliyun/odps/modelable.rb', line 7

def has_many(models, _opts = {})
  mod = models.to_s.singularize
  klass = "Aliyun::Odps::#{mod.camelize}s".constantize
  define_method(models) do
    klass.build(self)
  end
end