Module: Interfacets::Shared::Entities::Specs::Acceptable

Included in:
Accessor, Action, Association
Defined in:
lib/interfacets/shared/entities/specs.rb

Instance Method Summary collapse

Instance Method Details

#accepted_by?(role) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/interfacets/shared/entities/specs.rb', line 16

def accepted_by?(role)
  standardized_accepted_by == ANY || standardized_accepted_by.include?(role)
end

#standardized_accepted_by ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/interfacets/shared/entities/specs.rb', line 20

def standardized_accepted_by
  @standardized_accepted_by ||= (
    if accepted_by == ANY
      ANY
    else
       Array(accepted_by).map(&:to_s)
    end
  )
end