Class: PrettyPrint::Group

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(depth) ⇒ Group

Returns a new instance of Group.



303
304
305
306
307
# File 'lib/prettyprint.rb', line 303

def initialize(depth)
  @depth = depth
  @breakables = []
  @break = false
end

Instance Attribute Details

#breakablesObject (readonly)

Returns the value of attribute breakables



308
309
310
# File 'lib/prettyprint.rb', line 308

def breakables
  @breakables
end

#depthObject (readonly)

Returns the value of attribute depth



308
309
310
# File 'lib/prettyprint.rb', line 308

def depth
  @depth
end

Instance Method Details

#breakObject



310
311
312
# File 'lib/prettyprint.rb', line 310

def break
  @break = true
end

#break?Boolean

Returns:

  • (Boolean)


314
315
316
# File 'lib/prettyprint.rb', line 314

def break?
  @break
end

#first?Boolean

Returns:

  • (Boolean)


318
319
320
321
322
323
324
325
# File 'lib/prettyprint.rb', line 318

def first?
  if defined? @first
    false
  else
    @first = false
    true
  end
end