Class: Odca::Overlays::Header
- Inherits:
-
Object
- Object
- Odca::Overlays::Header
- Defined in:
- lib/odca/overlays/header.rb
Instance Attribute Summary collapse
-
#issued_by ⇒ Object
readonly
Returns the value of attribute issued_by.
-
#purpose ⇒ Object
readonly
Returns the value of attribute purpose.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(role:, purpose:, type:, issued_by: '') ⇒ Header
constructor
A new instance of Header.
- #to_h ⇒ Object
Constructor Details
#initialize(role:, purpose:, type:, issued_by: '') ⇒ Header
Returns a new instance of Header.
6 7 8 9 10 11 |
# File 'lib/odca/overlays/header.rb', line 6 def initialize(role:, purpose:, type:, issued_by: '') @issued_by = issued_by @role = role @purpose = purpose @type = type end |
Instance Attribute Details
#issued_by ⇒ Object (readonly)
Returns the value of attribute issued_by.
4 5 6 |
# File 'lib/odca/overlays/header.rb', line 4 def issued_by @issued_by end |
#purpose ⇒ Object (readonly)
Returns the value of attribute purpose.
4 5 6 |
# File 'lib/odca/overlays/header.rb', line 4 def purpose @purpose end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
4 5 6 |
# File 'lib/odca/overlays/header.rb', line 4 def role @role end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/odca/overlays/header.rb', line 4 def type @type end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/odca/overlays/header.rb', line 13 def to_h { '@context' => 'https://odca.tech/overlays/v1', type: type, issued_by: issued_by, role: role || '', purpose: purpose || '' } end |