lib/faker.rb
# Helper for the common approach of grabbing a translation
# with an array of values and selecting one of them.
Helper for the common approach of grabbing a translation
with an array of values and selecting one of them.
Helper for the common approach of grabbing a translation with an array of values and selecting one of them .
def fetch(key)
        fetched = sample(translate("faker.#{key}"))
        if fetched && fetched.match(/^\//) and fetched.match(/\/$/) 
          regexify(fetched)
        else
          fetched
        end
      end
def fetch ( key ) fetched = sample ( translate ( "faker.#{key}" ) ) if fetched && fetched . match ( / ^ \/ / ) and fetched . match ( / \/ $ / ) regexify ( fetched ) else fetched end end
Helper for the common approach of grabbing a translation
with an array of values and selecting one of them.
Helper for the common approach of grabbing a translation with an array of values and selecting one of them .
# A regex
key