Class: PrettyPrint::Group
- Inherits:
-
Object
- Object
- PrettyPrint::Group
- Defined in:
- lib/prettyprint.rb
Instance Attribute Summary collapse
-
#breakables ⇒ Object
readonly
Returns the value of attribute breakables.
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
Instance Method Summary collapse
- #break ⇒ Object
- #break? ⇒ Boolean
- #first? ⇒ Boolean
-
#initialize(depth) ⇒ Group
constructor
A new instance of Group.
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
#breakables ⇒ Object (readonly)
Returns the value of attribute breakables
308 309 310 |
# File 'lib/prettyprint.rb', line 308 def breakables @breakables end |
#depth ⇒ Object (readonly)
Returns the value of attribute depth
308 309 310 |
# File 'lib/prettyprint.rb', line 308 def depth @depth end |
Instance Method Details
#break ⇒ Object
310 311 312 |
# File 'lib/prettyprint.rb', line 310 def break @break = true end |
#break? ⇒ Boolean
314 315 316 |
# File 'lib/prettyprint.rb', line 314 def break? @break end |
#first? ⇒ 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 |