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



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

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

Returns:

  • (Boolean)


12
13
14
# File 'lib/jirametrics/self_or_issue_dispatcher.rb', line 12

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