Completed
Push — master ( 38d411...610bf2 )
by Yoh
01:37
created

ProxyComponent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render_proc() 0 3 1
A render_proc=() 0 3 1
A render() 0 3 1
1
class ProxyComponent
2
  include Component
3
  include Component::ShortHand
4
5
  def self.render_proc=(proc)
6
    @render_proc = proc
7
  end
8
9
  def self.render_proc
10
    @render_proc
11
  end
12
13
  def render
14
    self.instance_exec(@props, &self.class.render_proc)
15
  end
16
end
17