Class: Postcodes::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/postcodes_io/base.rb

Direct Known Subclasses

AutocompleteList, Postcode

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object

allow accessing info values with dot notation



4
5
6
7
8
# File 'lib/postcodes_io/base.rb', line 4

def method_missing(name, *args, &block)
  return @info[name.to_s] if @info.key? name.to_s
  return @info[name] if @info.key? name
  super.method_missing name
end