Class: Hecks::Bluebook::MetaValidator::Plan::Category

Inherits:
Struct
  • Object
show all
Defined in:
lib/hecks/bluebook/meta_validator/plan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alternatesObject

Returns the value of attribute alternates

Returns:

  • (Object)

    the current value of alternates



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def alternates
  @alternates
end

#appendsObject

Returns the value of attribute appends

Returns:

  • (Object)

    the current value of appends



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def appends
  @appends
end

#declareObject

Returns the value of attribute declare

Returns:

  • (Object)

    the current value of declare



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def declare
  @declare
end

#entity_ownedObject

Returns the value of attribute entity_owned

Returns:

  • (Object)

    the current value of entity_owned



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def entity_owned
  @entity_owned
end

#fieldsObject

Returns the value of attribute fields

Returns:

  • (Object)

    the current value of fields



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def fields
  @fields
end

#identity_pathsObject

Returns the value of attribute identity_paths

Returns:

  • (Object)

    the current value of identity_paths



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def identity_paths
  @identity_paths
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def name
  @name
end

#parentObject

Returns the value of attribute parent

Returns:

  • (Object)

    the current value of parent



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def parent
  @parent
end

#parent_keyObject

Returns the value of attribute parent_key

Returns:

  • (Object)

    the current value of parent_key



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def parent_key
  @parent_key
end

#referencesObject

Returns the value of attribute references

Returns:

  • (Object)

    the current value of references



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def references
  @references
end

#sealersObject

Returns the value of attribute sealers

Returns:

  • (Object)

    the current value of sealers



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def sealers
  @sealers
end

#settersObject

Returns the value of attribute setters

Returns:

  • (Object)

    the current value of setters



44
45
46
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 44

def setters
  @setters
end

Instance Method Details

#references?(verb, argument) ⇒ Boolean

DOES THIS ARGUMENT CARRY AN ID? A reference is the id of a head, and an id is a scalar — so the judge offers it bare, where every other field goes as a one-field value object. The language answers this about itself, so declaring a new reference needs no change here.

Returns:

  • (Boolean)


60
61
62
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 60

def references?(verb, argument)
  Array(references[verb.to_s]).include?(argument.to_s)
end

#root?Boolean

Returns:

  • (Boolean)


64
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 64

def root? = parent.nil?

#verbsObject

Every verb this category declares, in declaration order. alternates matters here: two commands can append to one list, and a verb missing from this is a verb the coverage gate stops watching.



51
52
53
54
# File 'lib/hecks/bluebook/meta_validator/plan.rb', line 51

def verbs
  [declare, *setters.map(&:verb), *appends.values.map(&:verb),
   *alternates.map(&:verb), *sealers].compact
end