Class: KirguduBase::DynamicPages::EventAction

Inherits:
Element
  • Object
show all
Defined in:
app/models/kirgudu_base/dynamic_pages/event_action.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#parent_entry

Instance Method Summary collapse

Methods inherited from Element

#as_json, #fix_parent_entry, #kontroller_klass

Methods included from Models::MergeableElements::ClassMethods

#get_mergeable_attributes, #mergeable_attributes

Methods included from Models::FixableElements::ClassMethods

#fixable_attributes, #get_kb_fixable_attributes

Methods included from Models::FixableElements::InstanceMethods

#fix_parent_entry

Methods included from Models::MergeableElements::InstanceMethods

#merge

Constructor Details

#initialize(options = {}) ⇒ EventAction

Returns a new instance of EventAction.



13
14
15
16
17
18
19
20
21
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 13

def initialize(options = {})
	self.name = nil
	self.constraint = nil
	self.data_source = nil
	self.target = nil
	self.description = nil

	super(options)
end

Instance Attribute Details

#constraintObject

Returns the value of attribute constraint.



25
26
27
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 25

def constraint
  @constraint
end

#data_sourceObject

Returns the value of attribute data_source.



26
27
28
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 26

def data_source
  @data_source
end

#descriptionObject

Returns the value of attribute description.



28
29
30
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 28

def description
  @description
end

#nameObject

Returns the value of attribute name.



24
25
26
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 24

def name
  @name
end

#targetObject

Returns the value of attribute target.



27
28
29
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 27

def target
  @target
end

Instance Method Details

#to_external_hash(options = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'app/models/kirgudu_base/dynamic_pages/event_action.rb', line 31

def to_external_hash(options = {})
	options ||= {}
	options.merge!({
		               name: self.name,
		               target: (self.target if self.target),
		               constraint: ( {
			               name: self.constraint.name,
			               values: self.constraint.values
		               } if self.constraint ),
	                   data_source: (self.data_source.to_external_hash(nil) if self.data_source)



	               })
	options[:constraint] = {
		name: self.constraint.name,
		values: self.constraint.values
	} if self.constraint

	super(options)
end