Sha256: ee734788c5f919a5c52bc2242869fcc5c3f6b5308d74f730530c05557b4eae7e

Contents?: true

Size: 416 Bytes

Versions: 20

Compression:

Stored size: 416 Bytes

Contents

require 'rails_blocks/blocks/renderer'
module RailsBlocks
	module Blocks
		class Block
			include Blocks::Renderer
			attr_accessor :name
			attr_accessor :options
			attr_accessor :content
			
			def initialize(name)
				@name = name
			end
			
			def render
				".#{klass}\n\t#{render_content}"
			end
			
			def render_content
				instance_eval &content
			end
			
			
			def klass
				@name
			end
		end
	end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rails_blocks-0.9.0.beta.5 lib/rails_blocks/blocks/block.rb
rails_blocks-0.9.0.beta.4 lib/rails_blocks/blocks/block.rb
rails_blocks-0.9.0.beta.3 lib/rails_blocks/blocks/block.rb
rails_blocks-0.9.0.beta.2 lib/rails_blocks/blocks/block.rb
rails_blocks-0.9.0.beta.1 lib/rails_blocks/blocks/block.rb
rails_blocks-0.8.1 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.12 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.11 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.10 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.9 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.8 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.7 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.6 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.5 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.4 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.3 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.2 lib/rails_blocks/blocks/block.rb
rails_blocks-0.7.1 lib/rails_blocks/blocks/block.rb
rails_blocks-0.6.5 lib/rails_blocks/blocks/block.rb
rails_blocks-0.6.4 lib/rails_blocks/blocks/block.rb