Module: KirguduBase::Models::FixableElements::ClassMethods

Included in:
DynamicPages::Element
Defined in:
app/helpers/kirgudu_base/models/fixable_elements.rb

Instance Method Summary collapse

Instance Method Details

#fixable_attributes(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/kirgudu_base/models/fixable_elements.rb', line 5

def fixable_attributes(*args)
	@fixable_attributes = self.get_kb_fixable_attributes
	options = args.extract_options! || {}
	args.each do |argument|
		unless argument.is_a?(Symbol)
			raise "Class: #{self} <br/>Fixable Attributes must be of Symbol Class".html_safe
		end
		if @fixable_attributes.include?(argument)
			raise "Class: #{self} <br/>Attribute '#{argument}' already added to Fixable for this Class".html_safe
		end

		@fixable_attributes << argument
	end

end

#get_kb_fixable_attributesObject



21
22
23
# File 'app/helpers/kirgudu_base/models/fixable_elements.rb', line 21

def get_kb_fixable_attributes
	@fixable_attributes || []
end