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.



287
288
289
290
291
# File 'lib/prettyprint.rb', line 287

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

Instance Attribute Details

#breakablesObject (readonly)

Returns the value of attribute breakables



292
293
294
# File 'lib/prettyprint.rb', line 292

def breakables
  @breakables
end

#depthObject (readonly)

Returns the value of attribute depth



292
293
294
# File 'lib/prettyprint.rb', line 292

def depth
  @depth
end

Instance Method Details

#breakObject



294
295
296
# File 'lib/prettyprint.rb', line 294

def break
  @break = true
end

#break?Boolean

Returns:

  • (Boolean)


298
299
300
# File 'lib/prettyprint.rb', line 298

def break?
  @break
end

#first?Boolean

Returns:

  • (Boolean)


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

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