Sha256: aa8dff42205ae08d66fa9e4bf62aeb82921e7b6a21184e2ecbeee699f168e524
Contents?: true
Size: 1.44 KB
Versions: 18
Compression:
Stored size: 1.44 KB
Contents
module KirguduBase module DynamicPages class EventAction < ::KirguduBase::DynamicPages::Element mergeable_attributes :name, :constraint, :data_source, :target, :description fixable_attributes :constraint, :data_source validates_presence_of :name validates_inclusion_of :name, in: ::KirguduBase::DynamicPages::Enums::SUPPORTED_ACTIONS, allow_nil: true, message: "Action Not Supported. Supported Actions are #{::KirguduBase::DynamicPages::Enums::SUPPORTED_ACTIONS.map { |i| ":#{i}" }.join(", ")}" def initialize(options = {}) self.name = nil self.constraint = nil self.data_source = nil self.target = nil self.description = nil super(options) end attr_accessor :name attr_accessor :constraint attr_accessor :data_source attr_accessor :target attr_accessor :description 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 end end end
Version data entries
18 entries across 18 versions & 1 rubygems