Class: RailsBlocks::Blocks::Block
- Inherits:
-
Object
- Object
- RailsBlocks::Blocks::Block
- Includes:
- Renderer
- Defined in:
- lib/rails_blocks/blocks/block.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name) ⇒ Block
constructor
A new instance of Block.
- #klass ⇒ Object
- #render ⇒ Object
- #render_content ⇒ Object
Methods included from Renderer
Constructor Details
#initialize(name) ⇒ Block
Returns a new instance of Block.
10 11 12 |
# File 'lib/rails_blocks/blocks/block.rb', line 10 def initialize(name) @name = name end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
8 9 10 |
# File 'lib/rails_blocks/blocks/block.rb', line 8 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/rails_blocks/blocks/block.rb', line 6 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/rails_blocks/blocks/block.rb', line 7 def @options end |
Instance Method Details
#klass ⇒ Object
23 24 25 |
# File 'lib/rails_blocks/blocks/block.rb', line 23 def klass @name end |
#render ⇒ Object
14 15 16 |
# File 'lib/rails_blocks/blocks/block.rb', line 14 def render ".#{klass}\n\t#{render_content}" end |
#render_content ⇒ Object
18 19 20 |
# File 'lib/rails_blocks/blocks/block.rb', line 18 def render_content instance_eval &content end |