module KirguduBase class DynamicPages::Menu < ::KirguduBase::DynamicPages::Element mergeable_attributes :name, :is_ajax, :elements fixable_attributes :elements validates_presence_of :name validates_inclusion_of :is_ajax, in: [:true, :false], allow_nil: true def initialize(options = {}) self.is_ajax = :false self.elements = nil self.name = nil super(options) end attr_accessor :is_ajax attr_accessor :elements attr_accessor :name def to_external_hash(options = {}) options ||= {} options.merge!({ is_ajax: self.is_ajax == :true, elements: self.elements, name: self.name }) super(options) end def items elements end end end