Module: Ea::Qea::Models::ScopePredicate

Included in:
EaAttribute, EaOperation
Defined in:
lib/ea/qea/models/scope_predicate.rb

Overview

Mixin providing public?, private?, protected? scope predicates for any model that has a scope attribute (t_attribute.scope, t_operation.scope, t_object.scope).

EA stores scope as a case-insensitive string ("Public", "Private", "Protected"). This module centralises the comparison so both EaAttribute and EaOperation share one implementation.

Instance Method Summary collapse

Instance Method Details

#private?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/ea/qea/models/scope_predicate.rb', line 19

def private?
  scope&.downcase == "private"
end

#protected?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/ea/qea/models/scope_predicate.rb', line 23

def protected?
  scope&.downcase == "protected"
end

#public?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/ea/qea/models/scope_predicate.rb', line 15

def public?
  scope&.downcase == "public"
end