class Patter::SourceProvider
Public Instance Methods
get_source(type)
click to toggle source
# File lib/patter/source_provider.rb, line 5 def get_source(type) Source.new(send(type)) end
Private Instance Methods
adjectives()
click to toggle source
# File lib/patter/source_provider.rb, line 19 def adjectives @adjectives ||= get_wordlist('adjectives') end
chars()
click to toggle source
# File lib/patter/source_provider.rb, line 15 def chars 'abcdefghijklmnopqrstuvwxyz'.split('').shuffle end
digits()
click to toggle source
# File lib/patter/source_provider.rb, line 31 def digits '123456789'.split('') end
get_wordlist(type)
click to toggle source
# File lib/patter/source_provider.rb, line 11 def get_wordlist(type) File.read(Patter.root_dir + "/words/#{type}.txt").split end
nouns()
click to toggle source
# File lib/patter/source_provider.rb, line 23 def nouns @nouns ||= get_wordlist('nouns') end
symbols()
click to toggle source
# File lib/patter/source_provider.rb, line 27 def symbols '!#$%&()*+,-=./:;<?>@[\]^_'.split('') end