require 'yaml'

module Twigg
  module App
    module Quips
      QUIPS = YAML.load_file(Twigg::App.root + 'data' + 'quips.yml')

      def self.random
        QUIPS[rand(QUIPS.size)]
      end
    end
  end
end

require 'yaml'

module Twigg
  module App
    module Quips
      QUIPS = YAML.load_file(App.root + 'data' + 'quips.yml')

      def self.random
        QUIPS.sample
      end
    end
  end
end

Apply minor tweaks to Quips module
Apply minor tweaks to Quips module

We don't need a fully qualified namespace to access the App root, so
trim it.

Likewise, we can use Array#sample to achieve the same effects, while
avoiding getting our hands dirty with the random numbers.

Change-Id: I8909540e85477118cf2042a74e2517bb41f42c42
Reviewed-on: https://gerrit.causes.com/26198
Reviewed-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
Tested-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
