Module: GitCompound::Command::Procedure::Element::Subprocedure::ClassMethods

Defined in:
lib/git_compound/command/procedure/element/subprocedure.rb

Overview

Class methods for extended class

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#subproceduresObject (readonly)

Returns the value of attribute subprocedures.



29
30
31
# File 'lib/git_compound/command/procedure/element/subprocedure.rb', line 29

def subprocedures
  @subprocedures
end

Instance Method Details

#add_subprocedure(name, procedure) ⇒ Object



31
32
33
34
# File 'lib/git_compound/command/procedure/element/subprocedure.rb', line 31

def add_subprocedure(name, procedure)
  @subprocedures = {} unless @subprocedures
  @subprocedures.store(name.to_sym, procedure)
end

#optionsObject



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/git_compound/command/procedure/element/subprocedure.rb', line 36

def options
  subprocedure_options = {}
  @subprocedures.to_h.each do |_, procedure|
    subprocedure_options.merge!(procedure.options)
  end

  subprocedure_options.select! do |_param, |
    [:scope] == :global
  end

  subprocedure_options.merge(super)
end