Class: Type::Conditions

Inherits:
Object show all
Defined in:
lib/platypus/type.rb

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Conditions

Returns a new instance of Conditions.



90
91
92
# File 'lib/platypus/type.rb', line 90

def initialize(type)
  @type = type
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(s, *a, &b) ⇒ Object

def __conditions__

@__conditions__ ||= []

end



98
99
100
101
102
103
# File 'lib/platypus/type.rb', line 98

def method_missing(s, *a, &b)
  @type.condition do |x|
    x.__send__(s, *a, &b)
  end
  #__conditions__ << [s, a, b]
end