Class: Archsight::Annotations::Computed
- Inherits:
-
Object
- Object
- Archsight::Annotations::Computed
- Defined in:
- lib/archsight/annotations/computed.rb
Overview
Computed represents a computed annotation definition. It stores the key, description, optional type, and the computation block.
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(key, description: nil, type: nil, &block) ⇒ Computed
constructor
A new instance of Computed.
-
#matches?(other_key) ⇒ Boolean
Check if this definition matches a given key.
Constructor Details
#initialize(key, description: nil, type: nil, &block) ⇒ Computed
Returns a new instance of Computed.
11 12 13 14 15 16 |
# File 'lib/archsight/annotations/computed.rb', line 11 def initialize(key, description: nil, type: nil, &block) @key = key @description = description @type = type @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
9 10 11 |
# File 'lib/archsight/annotations/computed.rb', line 9 def block @block end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/archsight/annotations/computed.rb', line 9 def description @description end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/archsight/annotations/computed.rb', line 9 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/archsight/annotations/computed.rb', line 9 def type @type end |
Instance Method Details
#matches?(other_key) ⇒ Boolean
Check if this definition matches a given key
19 20 21 |
# File 'lib/archsight/annotations/computed.rb', line 19 def matches?(other_key) @key == other_key end |