Class: Polites::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/polites/text.rb

Overview

A piece of simple text to be output directly. A stand-in for a simple string.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Text

Returns a new instance of Text.

Parameters:

  • text (String)


10
11
12
# File 'lib/polites/text.rb', line 10

def initialize(text)
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



7
8
9
# File 'lib/polites/text.rb', line 7

def text
  @text
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


14
15
16
# File 'lib/polites/text.rb', line 14

def eql?(other)
  other.is_a?(self.class) && text == other.text
end