Sha256: 7d5bd5370c92e205faddf35535e74594b656282ff2a439c45879171f39351af5

Contents?: true

Size: 868 Bytes

Versions: 3

Compression:

Stored size: 868 Bytes

Contents

module KirguduBase
	class DynamicPages::HtmlHeaderBuilder < ::KirguduBase::DynamicPages::Builder




		def initialize(&block)
			self.builder_options.merge!(
				{
					scripts: [],
					style_sheets: [],
					metas: []
				}
			)
			super(&block)
		end

		def script(path = nil, &block)
			self.builder_options[:scripts] << ::KirguduBase::DynamicPages::HtmlScriptBuilder.new(path, &block).to_element
		end


		def style_sheet(path, &block)
			self.builder_options[:style_sheets] << ::KirguduBase::DynamicPages::HtmlCssBuilder.new(path, &block).to_element
		end

		def meta(&block)
			self.builder_options[:metas] << ::KirguduBase::DynamicPages::HtmlMetaBuilder.new(&block).to_element
		end



		def to_element
			element = ::KirguduBase::DynamicPages::HtmlHeader.new
			self.build_element(element)
			self.validate_generated_element(element)
			element
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kirgudu_base-0.0.25 app/models/kirgudu_base/dynamic_pages/html_header_builder.rb
kirgudu_base-0.0.23 app/models/kirgudu_base/dynamic_pages/html_header_builder.rb
kirgudu_base-0.0.22 app/models/kirgudu_base/dynamic_pages/html_header_builder.rb