Class: Igniter::Lang::MetadataManifest
- Inherits:
-
Object
- Object
- Igniter::Lang::MetadataManifest
- Defined in:
- lib/igniter/lang/metadata_manifest.rb
Constant Summary collapse
- SEMANTICS =
{ report_only: true, runtime_enforced: false }.freeze
Instance Attribute Summary collapse
-
#budgets ⇒ Object
readonly
Returns the value of attribute budgets.
-
#descriptors ⇒ Object
readonly
Returns the value of attribute descriptors.
-
#return_types ⇒ Object
readonly
Returns the value of attribute return_types.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(descriptors: [], return_types: [], budgets: []) ⇒ MetadataManifest
constructor
A new instance of MetadataManifest.
- #report_only? ⇒ Boolean
- #runtime_enforced? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(descriptors: [], return_types: [], budgets: []) ⇒ MetadataManifest
Returns a new instance of MetadataManifest.
21 22 23 24 25 26 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 21 def initialize(descriptors: [], return_types: [], budgets: []) @descriptors = freeze_entries(descriptors) @return_types = freeze_entries(return_types) @budgets = freeze_entries(budgets) freeze end |
Instance Attribute Details
#budgets ⇒ Object (readonly)
Returns the value of attribute budgets.
11 12 13 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 11 def budgets @budgets end |
#descriptors ⇒ Object (readonly)
Returns the value of attribute descriptors.
11 12 13 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 11 def descriptors @descriptors end |
#return_types ⇒ Object (readonly)
Returns the value of attribute return_types.
11 12 13 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 11 def return_types @return_types end |
Class Method Details
.from_operations(operations) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 13 def self.from_operations(operations) new( descriptors: extract_descriptors(operations), return_types: extract_return_types(operations), budgets: extract_budgets(operations) ) end |
Instance Method Details
#report_only? ⇒ Boolean
28 29 30 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 28 def report_only? true end |
#runtime_enforced? ⇒ Boolean
32 33 34 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 32 def runtime_enforced? false end |
#to_h ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/igniter/lang/metadata_manifest.rb', line 36 def to_h { descriptors: descriptors, return_types: return_types, budgets: budgets, stores: [], invariants: [], semantics: SEMANTICS } end |