Class: Hashira::Boundaries::Declaration
- Inherits:
-
Data
- Object
- Data
- Hashira::Boundaries::Declaration
- Defined in:
- lib/hashira/boundaries.rb
Instance Attribute Summary collapse
-
#entrypoint ⇒ Object
readonly
Returns the value of attribute entrypoint.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
Instance Attribute Details
#entrypoint ⇒ Object (readonly)
Returns the value of attribute entrypoint
8 9 10 |
# File 'lib/hashira/boundaries.rb', line 8 def entrypoint @entrypoint end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason
8 9 10 |
# File 'lib/hashira/boundaries.rb', line 8 def reason @reason end |
#role ⇒ Object (readonly)
Returns the value of attribute role
8 9 10 |
# File 'lib/hashira/boundaries.rb', line 8 def role @role end |
#root ⇒ Object (readonly)
Returns the value of attribute root
8 9 10 |
# File 'lib/hashira/boundaries.rb', line 8 def root @root end |
Instance Method Details
#verify ⇒ Object
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 |