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