Sha256: d182dfea32864804ef593d503ead0901a8e44a56817ecfdb72bcf3149669f168

Contents?: true

Size: 438 Bytes

Versions: 2

Compression:

Stored size: 438 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.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.3 such_test_bot/src/such_test_bot.rb
twitter_bot_generator-0.2.2 such_test_bot/src/such_test_bot.rb