Class: PlainText::Part::Paragraph

Inherits:
Object
  • Object
show all
Includes:
BuiltinType, StringType
Defined in:
lib/plain_text/part/paragraph.rb

Overview

Class to express a Paragraph as String

Constant Summary collapse

Empty =

Empty Paragraph instance

self.new ""

Instance Method Summary collapse

Methods included from StringType

#clone, #dup, #inspect, #method_missing, #respond_to_missing?, #to_s

Methods included from BuiltinType

#subclass_name

Constructor Details

#initialize(str) ⇒ Paragraph

Constructor

Parameters:



18
19
20
# File 'lib/plain_text/part/paragraph.rb', line 18

def initialize(str)
  @string = str
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PlainText::Part::StringType

Instance Method Details

#<=>(other) ⇒ Integer, NilClass

Returns:

  • (Integer, NilClass)


29
30
31
# File 'lib/plain_text/part/paragraph.rb', line 29

def <=>(other)
  _equal_cmp(other, __method__){ super }
end

#==(other) ⇒ Object

String#== refers to this.



36
37
38
# File 'lib/plain_text/part/paragraph.rb', line 36

def ==(other)
  _equal_cmp(other, __method__){ super }
end

#boundary?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/plain_text/part/paragraph.rb', line 40

def boundary?
  false
end

#paragraph?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/plain_text/part/paragraph.rb', line 44

def paragraph?
  true
end

#part?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/plain_text/part/paragraph.rb', line 48

def part?
  false
end