Class: PartGroup

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Comparable
Defined in:
lib/rmsgen/part_group.rb

Constant Summary collapse

CRNL =

Carriage return new line.

/\r\n/
CRNL_CRNL =
/\r\n\r\n/
DELIMETER =
"\n\n"
NL =
/\n/
NL_NL =
/\n\n/
NL_PLACEHOLDER =
'[newline]'
SPACE =
' '

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ PartGroup

Returns a new instance of PartGroup.



22
23
24
25
26
# File 'lib/rmsgen/part_group.rb', line 22

def initialize(text)
  @text = text
  @parts = []
  assign_parts!
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



17
18
19
# File 'lib/rmsgen/part_group.rb', line 17

def parts
  @parts
end

#textObject (readonly)

Returns the value of attribute text.



17
18
19
# File 'lib/rmsgen/part_group.rb', line 17

def text
  @text
end

Instance Method Details

#<=>(other) ⇒ Object



28
29
30
# File 'lib/rmsgen/part_group.rb', line 28

def <=>(other)
  parts.map(&:to_s) <=> other.map(&:to_s)
end