Class: RailsBlocks::Blocks::Block

Inherits:
Object
  • Object
show all
Includes:
Renderer
Defined in:
lib/rails_blocks/blocks/block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Renderer

#b, #e

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

#contentObject

Returns the value of attribute content.



8
9
10
# File 'lib/rails_blocks/blocks/block.rb', line 8

def content
  @content
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/rails_blocks/blocks/block.rb', line 6

def name
  @name
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/rails_blocks/blocks/block.rb', line 7

def options
  @options
end

Instance Method Details

#klassObject



23
24
25
# File 'lib/rails_blocks/blocks/block.rb', line 23

def klass
	@name
end

#renderObject



14
15
16
# File 'lib/rails_blocks/blocks/block.rb', line 14

def render
	".#{klass}\n\t#{render_content}"
end

#render_contentObject



18
19
20
# File 'lib/rails_blocks/blocks/block.rb', line 18

def render_content
	instance_eval &content
end