module Dogsay

Constants

VERSION

Public Class Methods

say(string, opts={}) click to toggle source
# File lib/dogsay.rb, line 14
def say(string, opts={})
  options = config.merge opts
  dog     = Dogsay::Dog.new(options)
  text    = Dogsay::TextBox.new(string, options)
  boxed   = options[:raw] ? text.raw : text.ascii
  dog.add_art(boxed, on_the: dog.text_position)
end

Private Class Methods

config() click to toggle source
# File lib/dogsay.rb, line 24
def config
  begin
    defaults.merge(YAML.load_file "#{ENV['HOME']}/.dogsay")
  rescue Errno::ENOENT
    defaults
  end
end
defaults() click to toggle source
# File lib/dogsay.rb, line 32
def defaults
  {
    animal: :dog,
    pose:   :default
  }
end