class Cattri::AttributeCompiler

def define_predicate!(attribute, context)

Returns:
  • (void) -

Parameters:
  • context (Cattri::Context) --
  • attribute (Cattri::Attribute) --
def define_predicate!(attribute, context)
  context.define_method(attribute, name: :"#{attribute.name}?") do
    !!send(attribute.name) # rubocop:disable Style/DoubleNegation
  end
end