class ObliqueStrategies

Constants

DEFAULT_STRATEGY_PATH
VERSION

Public Class Methods

card() click to toggle source

Class-level shortcut for creating a deck, and quickly drawing a random card.

# File lib/oblique_strategies.rb, line 20
def self.card
  new.card
end
new(path: DEFAULT_STRATEGY_PATH) click to toggle source
# File lib/oblique_strategies.rb, line 10
def initialize(path: DEFAULT_STRATEGY_PATH)
  @deck = File.readlines(path).map(&:chomp).map(&:strip)
end

Public Instance Methods

card() click to toggle source

Draw a random card from the Array

# File lib/oblique_strategies.rb, line 15
def card
  @deck.sample
end