Class: Entitlements::Rule::Base

Inherits:
Object
  • Object
show all
Includes:
Contracts::Core
Defined in:
lib/entitlements/rule/base.rb

Constant Summary collapse

C =
::Contracts

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Contracts::Core

common, extended, included

Class Method Details

.description(text = nil) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/entitlements/rule/base.rb', line 29

def self.description(text = nil)
  if text
    @description = text
  else
    @description ||= ""
  end
end

.filter(filter_pair = nil) ⇒ Object



53
54
55
56
57
# File 'lib/entitlements/rule/base.rb', line 53

def self.filter(filter_pair = nil)
  @filters ||= Entitlements::Data::Groups::Calculated.filters_default
  @filters.merge!(filter_pair) if filter_pair
  @filters
end

Instance Method Details

#descriptionObject



43
44
45
# File 'lib/entitlements/rule/base.rb', line 43

def description
  self.class.description
end

#filtersObject



65
66
67
# File 'lib/entitlements/rule/base.rb', line 65

def filters
  self.class.filter
end

#membersObject



17
18
19
20
21
# File 'lib/entitlements/rule/base.rb', line 17

def members
  # :nocov:
  raise "Must be implemented by the child class"
  # :nocov:
end