Class: Foobara::Manifest::Command

Inherits:
BaseManifest show all
Defined in:
foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Attribute Summary

Attributes inherited from BaseManifest

#path, #root_manifest

Instance Method Summary collapse

Methods inherited from BaseManifest

#==, #[], category_to_manifest_class, #domain, #eql?, #find_type, #global_domain, #global_organization, #hash, #initialize, #key?, #method_missing, optional_key, #optional_key?, optional_key_defaults, optional_keys, #organization, #parent, #parent_category, #parent_name, #relevant_manifest, #respond_to_missing?, #scoped_category

Methods included from TruncatedInspect

#inspect, truncating

Constructor Details

This class inherits a constructor from Foobara::Manifest::BaseManifest

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Foobara::Manifest::BaseManifest

Instance Method Details

#command_manifestObject



12
13
14
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 12

def command_manifest
  relevant_manifest
end

#command_nameObject



16
17
18
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 16

def command_name
  scoped_short_name
end

#errors_types_depended_onObject



58
59
60
61
62
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 58

def errors_types_depended_on
  @errors_types_depended_on ||= self[:errors_types_depended_on]&.to_set do |type_reference|
    Type.new(root_manifest, [:type, type_reference])
  end || Set.new
end

#full_command_nameObject



20
21
22
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 20

def full_command_name
  scoped_full_name
end

#inputs_typeObject



24
25
26
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 24

def inputs_type
  Attributes.new(root_manifest, [*path, :inputs_type])
end

#inputs_types_depended_onObject



46
47
48
49
50
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 46

def inputs_types_depended_on
  @inputs_types_depended_on ||= self[:inputs_types_depended_on]&.map do |type_reference|
    Type.new(root_manifest, [:type, type_reference])
  end || []
end

#possible_errorsObject



34
35
36
37
38
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 34

def possible_errors
  (super || {}).keys.to_h do |key|
    [key, PossibleError.new(root_manifest, [*path, :possible_errors, key])]
  end
end

#requires_authentication?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 8

def requires_authentication?
  !!self[:requires_authentication]
end

#result_typeObject



28
29
30
31
32
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 28

def result_type
  TypeDeclaration.new(root_manifest, [*path, :result_type])
rescue Foobara::Manifest::InvalidPath
  nil
end

#result_types_depended_onObject



52
53
54
55
56
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 52

def result_types_depended_on
  @result_types_depended_on ||= self[:result_types_depended_on]&.to_set do |type_reference|
    Type.new(root_manifest, [:type, type_reference])
  end || Set.new
end

#types_depended_onObject



40
41
42
43
44
# File 'foobara-0.0.110/projects/manifest/src/foobara/manifest/command.rb', line 40

def types_depended_on
  @types_depended_on ||= self[:types_depended_on]&.map do |type_reference|
    Type.new(root_manifest, [:type, type_reference])
  end || []
end