Module: SelfOrIssueDispatcher

Included in:
ColumnsConfig, CycleTimeConfig, HtmlReportConfig
Defined in:
lib/jirametrics/self_or_issue_dispatcher.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object

rubocop:disable Style/ArgumentsForwarding



5
6
7
8
9
10
11
# File 'lib/jirametrics/self_or_issue_dispatcher.rb', line 5

def method_missing method_name, *args, &block
  raise "#{method_name} isn't a method on Issue or #{self.class}" unless ::Issue.method_defined? method_name.to_sym

  ->(issue) do # rubocop:disable Style/Lambda
    issue.__send__ method_name, *args, &block
  end
end

Instance Method Details

#respond_to_missing?(method_name, include_all = false) ⇒ Boolean

rubocop:enable Style/ArgumentsForwarding

Returns:

  • (Boolean)


14
15
16
# File 'lib/jirametrics/self_or_issue_dispatcher.rb', line 14

def respond_to_missing?(method_name, include_all = false)
  ::Issue.method_defined?(method_name.to_sym) || super
end