Sha256: a3cee7aff31d4ec50a89c2a9056f887169ea5cf8d38a23130795934e84cf78f7

Contents?: true

Size: 1.14 KB

Versions: 17

Compression:

Stored size: 1.14 KB

Contents

module KirguduBase
	module DynamicPages
		class EntryBuilder < ::KirguduBase::DynamicPages::PageElementBuilder

			def initialize(name, &block)

				self.builder_options.merge!({
					                            is_ajax: nil,
					                            properties: nil,
					                            parent: nil,
					                            http_method: nil
				                            })

				super(name, &block)
			end

			def http_method(value)
				self.builder_options[:http_method] = value
			end

			def parent(value)
				self.builder_options[:parent] = value
			end

			def is_ajax(value)
				self.builder_options[:is_ajax] = value
			end

			def properties(&block)
				elements = ::KirguduBase::DynamicPages::EntryPropertiesBlockBuilder.new(&block).to_elements

				elements.each do |element|
					self.builder_options[:properties] = {} unless self.builder_options[:properties]
					self.builder_options[:properties][element.name] = element
				end
			end


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

		end
	end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
kirgudu_base-0.0.21 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.19 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.18 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.17 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.16 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.15 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.14 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.13 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.12 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.11 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.10 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.9 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.8 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.7 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.6 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.5 app/models/kirgudu_base/dynamic_pages/entry_builder.rb
kirgudu_base-0.0.4 app/models/kirgudu_base/dynamic_pages/entry_builder.rb