Module: Dtn::Helpers::Catalog

Included in:
Dtn
Defined in:
lib/dtn/helpers/catalog.rb

Overview

Global catalog helpers

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



7
8
9
10
11
# File 'lib/dtn/helpers/catalog.rb', line 7

def method_missing(method_name, *, **)
  return super unless method_name.to_s.end_with?("_catalog")

  get_catalog(catalog: method_name.to_s.sub(/_catalog$/, ""))
end

Instance Method Details

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

Returns:

  • (Boolean)


13
14
15
# File 'lib/dtn/helpers/catalog.rb', line 13

def respond_to_missing?(method_name, include_private = false)
  method_name.to_s.end_with?("_catalog") || super
end