Sha256: e5511317411e6092ab16d1d4f8203dc49aec288080b7443074c034b3326ffdb6

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

class SuchTestBot

  class << self

    def generate
      greetings.sample
    end

  protected

    def greetings
      @greetings ||= load_txt_file 'greetings.txt'
    end

  private

    def load_txt_file file_name
      home_sweet_home = File.expand_path File.dirname __FILE__
      ultimate_pathway = File.join home_sweet_home, '..', 'lib', file_name
      (File.readlines ultimate_pathway).map &:strip
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter_bot_generator-0.2.1 such_test_bot/src/such_test_bot.rb
twitter_bot_generator-0.2.0 such_test_bot/src/such_test_bot.rb