Class: Icons::Configuration::Options

Inherits:
Hash
  • Object
show all
Defined in:
lib/icons/configuration/options.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/icons/configuration/options.rb', line 6

def method_missing(method_name, *args)
  if method_name.to_s.end_with?("=")
    key = method_name.to_s.chomp("=").to_sym
    self[key] = args.first
  else
    self[method_name]
  end
end

Instance Method Details

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/icons/configuration/options.rb', line 15

def respond_to_missing?(method_name, include_private = false)
  true
end