Class: Hashira::Boundaries::Declaration

Inherits:
Data
  • Object
show all
Defined in:
lib/hashira/boundaries.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entrypointObject (readonly)

Returns the value of attribute entrypoint

Returns:

  • (Object)

    the current value of entrypoint



8
9
10
# File 'lib/hashira/boundaries.rb', line 8

def entrypoint
  @entrypoint
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



8
9
10
# File 'lib/hashira/boundaries.rb', line 8

def reason
  @reason
end

#roleObject (readonly)

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



8
9
10
# File 'lib/hashira/boundaries.rb', line 8

def role
  @role
end

#rootObject (readonly)

Returns the value of attribute root

Returns:

  • (Object)

    the current value of root



8
9
10
# File 'lib/hashira/boundaries.rb', line 8

def root
  @root
end

Instance Method Details

#verifyObject

Raises:



10
11
12
13
14
15
# File 'lib/hashira/boundaries.rb', line 10

def verify
  missing = members.find { !present?(public_send(it)) }
  root, role, _entrypoint, _reason = deconstruct
  raise(Hashira::Error, "boundary #{root || "(unknown)"} #{missing} is missing") if missing
  raise(Hashira::Error, "boundary #{root} has unknown role #{role.inspect}") unless role == Hashira::Boundaries::ROLE
end