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 end end def to_element element = ::KirguduBase::DynamicPages::Entry.new self.build_element(element) self.validate_generated_element(element) element end end end end