Method: Rutty::Config#method_missing

Defined in:
lib/rutty/config.rb

#method_missing(sym, *args) ⇒ void

Allows for object accessor (dot) syntax to access the stored data. If the missing method ends with an equals, calls #[]=, otherwise calls #[]

Parameters:

  • sym (Symbol)

    The method symbol

  • args (*Array)

    The splatted array of method arguments

Since:

  • 2.0.0



92
93
94
95
96
97
98
# File 'lib/rutty/config.rb', line 92

def method_missing(sym, *args)
  if sym.to_s =~ /(.+)=$/
    self[$1] = args.first
  else
    self[sym]
  end
end