class Rage::Flip::Machine

Attributes

┬─┬[R]
┻━┻[R]
[R]
ヽ༼ຈل͜ຈ༽ノ[R]

Public Class Methods

new(flipper: nil, text: nil) click to toggle source
# File lib/rage/flip/machine.rb, line 6
def initialize(flipper: nil, text: nil)
  self.ヽ༼ຈل͜ຈ༽ノ = flipper
  self.┬─┬      = text
end

Public Instance Methods

ʕノ•ᴥ•ʔノ() click to toggle source
# File lib/rage/flip/machine.rb, line 25
def ʕノ•ᴥ•ʔノ
  return ヽ༼ຈل͜ຈ༽ノ if ⊙0⊙

  ヽ༼ຈل͜ຈ༽ノ % send(%i(┻━┻ ┬─┬).sample)
rescue
  "┗( ●-﹏ `。)づ"
end
༼ಠ益ಠ༽() click to toggle source
# File lib/rage/flip/machine.rb, line 21
def ༼ಠ益ಠ༽
  [SPILF, FLIPSPILF, FLIPS].map(&:keys).flatten.shuffle.sample
end
⁀⊙﹏☉⁀(text = TABLE) click to toggle source
# File lib/rage/flip/machine.rb, line 37
def ⁀⊙﹏☉⁀ text = TABLE
  return ELBAT if text.blank? || text.eql?(TABLE)
  text.split(//).reverse.map do |l|
    FLIPPED_LETTERS[l].nil? ? l : FLIPPED_LETTERS[l]
  end.join("")
end
⊙0⊙() click to toggle source
# File lib/rage/flip/machine.rb, line 33
def ⊙0⊙
  FLIPSPILF.key? 
end
┬─┬=(val) click to toggle source
# File lib/rage/flip/machine.rb, line 11
def ┬─┬=(val)
  @┬─┬ = val.presence || TABLE
  @┻━┻ = ⁀⊙﹏☉⁀(@┬─┬)
end
ヽ༼ຈل͜ຈ༽ノ=(val) click to toggle source
# File lib/rage/flip/machine.rb, line 16
def ヽ༼ຈل͜ຈ༽ノ=(val)
  @☆ = (val.presence || ༼ಠ益ಠ༽).to_s.to_sym
  @ヽ༼ຈل͜ຈ༽ノ = SPILF[@☆].presence || FLIPS[@☆].presence || FLIPSPILF[@☆].presence
end