Class: KirguduBase::DynamicPages::EventAction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ EventAction

Returns a new instance of EventAction.



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

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.



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

def constraint
  @constraint
end

#data_sourceObject

Returns the value of attribute data_source.



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

def data_source
  @data_source
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#targetObject

Returns the value of attribute target.



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

def target
  @target
end

Instance Method Details

#to_external_hash(options = {}) ⇒ Object



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

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