Module: Rubix::Associations::HasManyConditions

Included in:
Rubix::Action, Operation
Defined in:
lib/rubix/associations/has_many_conditions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


5
6
7
# File 'lib/rubix/associations/has_many_conditions.rb', line 5

def self.included klass
  klass.send(:zabbix_attr, :condition_operator, :default => :and_or, :required => true)
end

Instance Method Details

#conditionsObject


9
10
11
# File 'lib/rubix/associations/has_many_conditions.rb', line 9

def conditions
  @conditions ||= []
end

#conditions=(cs) ⇒ Object


13
14
15
16
17
# File 'lib/rubix/associations/has_many_conditions.rb', line 13

def conditions= cs
  @conditions = cs.map do |c|
    c.kind_of?(Condition) ? c : Condition.new(c)
  end
end