Module: NobleNames::Data

Defined in:
lib/noble_names/data.rb

Overview

The module responsible for maintaining and delivering the match data as defined in the data directory.

Constant Summary collapse

DATA_PATH =
File.expand_path('../../data', __dir__).freeze

Class Method Summary collapse

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

This returns an instance variable if it exists. Otherwise it calls super.



15
16
17
18
# File 'lib/noble_names/data.rb', line 15

def self.method_missing(method, *args, &block)
  var = instance_variable_get("@#{method}")
  var || super
end

.respond_to_missing?(method, *args, &block) ⇒ Boolean

Remember to define respond_to_missing.

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/noble_names/data.rb', line 21

def self.respond_to_missing?(method, *args, &block)
  var = instance_variable_get("@#{method}")
  var ? true : super
end