Class: CEML::Criteria

Inherits:
Struct
  • Object
show all
Defined in:
lib/ceml/role.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#matchingObject

Returns the value of attribute matching

Returns:

  • (Object)

    the current value of matching



3
4
5
# File 'lib/ceml/role.rb', line 3

def matching
  @matching
end

#minus_tagsObject

Returns the value of attribute minus_tags

Returns:

  • (Object)

    the current value of minus_tags



3
4
5
# File 'lib/ceml/role.rb', line 3

def minus_tags
  @minus_tags
end

#plus_tagsObject

Returns the value of attribute plus_tags

Returns:

  • (Object)

    the current value of plus_tags



3
4
5
# File 'lib/ceml/role.rb', line 3

def plus_tags
  @plus_tags
end

#radiusObject

Returns the value of attribute radius

Returns:

  • (Object)

    the current value of radius



3
4
5
# File 'lib/ceml/role.rb', line 3

def radius
  @radius
end

#timewindowObject

Returns the value of attribute timewindow

Returns:

  • (Object)

    the current value of timewindow



3
4
5
# File 'lib/ceml/role.rb', line 3

def timewindow
  @timewindow
end

Instance Method Details

#=~(candidate) ⇒ Object



5
6
7
8
# File 'lib/ceml/role.rb', line 5

def =~(candidate)
  candidate[:tags] ||= []
  (plus_tags - candidate[:tags]).empty? and (minus_tags & candidate[:tags]).empty?
end

#complexityObject



4
# File 'lib/ceml/role.rb', line 4

def complexity; plus_tags.size; end