Class: ViewCell::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/view-cell/proxy.rb

Overview

proxy loader class cell.user.foo -> cell(:user).foo

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Proxy

Returns a new instance of Proxy.



5
6
7
# File 'lib/view-cell/proxy.rb', line 5

def initialize parent
  @parent = parent
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(cell_name, vars = {}) ⇒ Object



9
10
11
# File 'lib/view-cell/proxy.rb', line 9

def method_missing cell_name, vars={}
  ViewCell.get(@parent, cell_name, vars)
end