Class: Shigeki
- Inherits:
-
Object
- Object
- Shigeki
- Defined in:
- lib/shigeki.rb
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#controller_name ⇒ Object
Returns the value of attribute controller_name.
-
#view_context ⇒ Object
Returns the value of attribute view_context.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(controller_name, view_context: nil) ⇒ Shigeki
constructor
A new instance of Shigeki.
Constructor Details
#initialize(controller_name, view_context: nil) ⇒ Shigeki
Returns a new instance of Shigeki.
4 5 6 7 |
# File 'lib/shigeki.rb', line 4 def initialize(controller_name, view_context: nil) @controller_name = controller_name @view_context = view_context end |
Instance Attribute Details
#controller_name ⇒ Object
Returns the value of attribute controller_name.
2 3 4 |
# File 'lib/shigeki.rb', line 2 def controller_name @controller_name end |
#view_context ⇒ Object
Returns the value of attribute view_context.
2 3 4 |
# File 'lib/shigeki.rb', line 2 def view_context @view_context end |
Instance Method Details
#data ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/shigeki.rb', line 9 def data(&) builder = Builder.new(controller_name, view_context: view_context) builder.instance_eval(&) builder.to_h end |