Sha256: b8b7beca5f2ec60f716f6241cfce0f491ba29f4b4a5939c2357482e660957b7a
Contents?: true
Size: 1.89 KB
Versions: 18
Compression:
Stored size: 1.89 KB
Contents
module KirguduBase module DynamicPages class PageTabBuilder < ::KirguduBase::DynamicPages::PageElementBuilder def initialize(name, &block) self.builder_options.merge!({ is_active: :false, lazy_select: :false, label: :nil, elements: [] }) super(name, &block) end def label(value) self.validate_empty_parameter('label', value) self.builder_options[:label] = value end def is_active(value) self.validate_empty_parameter('is_active', value) self.builder_options[:is_active] = value end def lazy_select(value) self.validate_empty_parameter('lazy_select', value) self.builder_options[:lazy_select] = value end def form(name, &block) raise "Cannot create empty Form" unless block_given? self.builder_options[:elements] << ::KirguduBase::DynamicPages::FormBuilder.new(name, &block).to_element end def list(name, &block) raise "Cannot create empty List" unless block_given? self.builder_options[:elements] << ::KirguduBase::DynamicPages::ListBuilder.new(name, &block).to_element end def group(name, &block) raise "Cannot create empty Group" unless block_given? self.builder_options[:elements] << ::KirguduBase::DynamicPages::GroupBuilder.new(name, ::KirguduBase::DynamicPages::Enums::ELEMENTS_FOR_PAGE_TAB, &block).to_element end def entry(name, &block) #raise "Error from List. List Name: #{name}" raise "Cannot create empty Entry" unless block_given? self.builder_options[:elements] << ::KirguduBase::DynamicPages::EntryBuilder.new(name, &block).to_element end def to_element element = ::KirguduBase::DynamicPages::PageTab.new self.build_element(element) self.validate_generated_element(element) element end end end end
Version data entries
18 entries across 18 versions & 1 rubygems