class Pangrid::Rebus

symbol: the symbol representing the solution in the grid

(populated by xword.encode_rebus!)

solution: the word the symbol represents display_char: optional character representation of a rebus square

Attributes

display_char[RW]
solution[RW]
symbol[RW]

Public Class Methods

new(str, char = nil) click to toggle source
# File lib/pangrid/xw.rb, line 15
def initialize(str, char = nil)
  @symbol = nil
  @solution = str
  @display_char = char || str[0]
end

Public Instance Methods

inspect() click to toggle source
# File lib/pangrid/xw.rb, line 25
def inspect
  "[#{symbol}|#{solution}]"
end
to_char() click to toggle source
# File lib/pangrid/xw.rb, line 21
def to_char
  symbol || display_char
end