Class: Igniter::Lang::MetadataManifest

Inherits:
Object
  • Object
show all
Defined in:
lib/igniter/lang/metadata_manifest.rb

Constant Summary collapse

SEMANTICS =
{
  report_only: true,
  runtime_enforced: false
}.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#budgetsObject (readonly)

Returns the value of attribute budgets.



11
12
13
# File 'lib/igniter/lang/metadata_manifest.rb', line 11

def budgets
  @budgets
end

#descriptorsObject (readonly)

Returns the value of attribute descriptors.



11
12
13
# File 'lib/igniter/lang/metadata_manifest.rb', line 11

def descriptors
  @descriptors
end

#return_typesObject (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

Returns:

  • (Boolean)


28
29
30
# File 'lib/igniter/lang/metadata_manifest.rb', line 28

def report_only?
  true
end

#runtime_enforced?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/igniter/lang/metadata_manifest.rb', line 32

def runtime_enforced?
  false
end

#to_hObject



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