Class: Foobara::Manifest::Command

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

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Attribute Summary

Attributes inherited from BaseManifest

#manifest_path, #root_manifest

Instance Method Summary collapse

Methods inherited from BaseManifest

#==, #[], category_to_manifest_class, #domain, #domain_reference, #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, #path, #relevant_manifest, #respond_to_missing?, #scoped_category, #symbol_path

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 'projects/manifest/src/command.rb', line 12

def command_manifest
  relevant_manifest
end

#command_nameObject



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

def command_name
  scoped_short_name
end

#errors_types_depended_onObject



62
63
64
65
66
# File 'projects/manifest/src/command.rb', line 62

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 'projects/manifest/src/command.rb', line 20

def full_command_name
  scoped_full_name
end

#inputs_typeObject



28
29
30
# File 'projects/manifest/src/command.rb', line 28

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

#inputs_types_depended_onObject



50
51
52
53
54
# File 'projects/manifest/src/command.rb', line 50

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



38
39
40
41
42
# File 'projects/manifest/src/command.rb', line 38

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

#query?Boolean

Returns:

  • (Boolean)


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

def query?
  self[:is_query]
end

#requires_authentication?Boolean

Returns:

  • (Boolean)


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

def requires_authentication?
  !!self[:requires_authentication]
end

#result_typeObject



32
33
34
35
36
# File 'projects/manifest/src/command.rb', line 32

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

#result_types_depended_onObject



56
57
58
59
60
# File 'projects/manifest/src/command.rb', line 56

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



44
45
46
47
48
# File 'projects/manifest/src/command.rb', line 44

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