lib/faker/address.rb
def method_missing(m, *args, &block)
        # Use the alternate form of translate to get a nil rather than a "missing translation" string
        if translation = I18n.translate(:faker)[:address][m]
          translation.respond_to?(:rand) ? translation.rand : translation
        else
          super
        end
      end
# You can add whatever you want to the locale file, and it will get 
# caught here... e.g., create a country_code array in your locale, 
# then you can call #country_code and it will act like #country
You can add whatever you want to the locale file, and it will get
caught here... e.g., create a country_code array in your locale,
then you can call #country_code and it will act like #country
You can add whatever you want to the locale file and it will get caught here ... e . g . create a country_code array in your locale then you can call #country_code and it will act like #country
def method_missing(m, *args, &block)
        if translation = I18n.translate(:faker)[:address][m]
          translation.respond_to?(:rand) ? translation.rand : translation
        else
          super
        end
      end
def method_missing ( m , * args , & block ) if translation = I18n . translate ( :faker ) [ :address ] [ m ] translation . respond_to? ( :rand ) ? translation . rand : translation else super end end
You can add whatever you want to the locale file, and it will get
caught here...
You can add whatever you want to the locale file and it will get caught here ...
# Use the alternate form of translate to get a nil rather than a "missing translation" string
m
args
block