Class: CEML::Tagspec

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#withObject

Returns the value of attribute with

Returns:

  • (Object)

    the current value of with



103
104
105
# File 'lib/ceml/models/cast.rb', line 103

def with
  @with
end

#withoutObject

Returns the value of attribute without

Returns:

  • (Object)

    the current value of without



103
104
105
# File 'lib/ceml/models/cast.rb', line 103

def without
  @without
end

Instance Method Details

#=~(c) ⇒ Object



104
105
106
107
# File 'lib/ceml/models/cast.rb', line 104

def =~(c)
  return false if (c[:tags]||[]).include?('new') and not with.include?('new')
  with.all?{ |t| (c[:tags]||[]).include?(t) } and without.all?{ |t| !(c[:tags]||[]).include?(t) }
end