Class: Prettyrb::Document::Join

Inherits:
Builder
  • Object
show all
Defined in:
lib/prettyrb/document.rb

Instance Attribute Summary collapse

Attributes inherited from Builder

#parts

Instance Method Summary collapse

Methods inherited from Builder

#each, #groups, #has_group_part?, #inspect, #max_group_depth

Constructor Details

#initialize(separator: ",", parts:) ⇒ Join

Returns a new instance of Join.



117
118
119
120
121
122
123
124
# File 'lib/prettyrb/document.rb', line 117

def initialize(separator: ",", parts:)
  if parts.is_a?(Array)
    super(*parts)
  else
    super(parts)
  end
  @separator = separator
end

Instance Attribute Details

#separatorObject (readonly)

Returns the value of attribute separator.



115
116
117
# File 'lib/prettyrb/document.rb', line 115

def separator
  @separator
end