module Grape::Entity::Condition
Public Class Methods
new_if(arg)
click to toggle source
# File lib/grape_entity/condition.rb, line 12 def new_if(arg) condition(false, arg) end
new_unless(arg)
click to toggle source
# File lib/grape_entity/condition.rb, line 16 def new_unless(arg) condition(true, arg) end
Private Class Methods
condition(inverse, arg)
click to toggle source
# File lib/grape_entity/condition.rb, line 22 def condition(inverse, arg) condition_klass = case arg when Hash then HashCondition when Proc then BlockCondition when Symbol then SymbolCondition end condition_klass.new(inverse, arg) end