Class: Leg::Representations::Git::State
- Inherits:
-
Object
- Object
- Leg::Representations::Git::State
- Defined in:
- lib/leg/representations/git.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#conflict ⇒ Object
Returns the value of attribute conflict.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#step_number ⇒ Object
Returns the value of attribute step_number.
Instance Method Summary collapse
- #add_commit! ⇒ Object
- #amend! ⇒ Object
- #conflict! ⇒ Object
-
#initialize ⇒ State
constructor
A new instance of State.
- #step!(step_number) ⇒ Object
Constructor Details
#initialize ⇒ State
Returns a new instance of State.
345 346 347 348 349 350 |
# File 'lib/leg/representations/git.rb', line 345 def initialize @step_number = nil @operation = nil @args = [] @conflict = false end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
343 344 345 |
# File 'lib/leg/representations/git.rb', line 343 def args @args end |
#conflict ⇒ Object
Returns the value of attribute conflict.
343 344 345 |
# File 'lib/leg/representations/git.rb', line 343 def conflict @conflict end |
#operation ⇒ Object
Returns the value of attribute operation.
343 344 345 |
# File 'lib/leg/representations/git.rb', line 343 def operation @operation end |
#step_number ⇒ Object
Returns the value of attribute step_number.
343 344 345 |
# File 'lib/leg/representations/git.rb', line 343 def step_number @step_number end |
Instance Method Details
#add_commit! ⇒ Object
357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/leg/representations/git.rb', line 357 def add_commit! if @operation.nil? @operation = :commit @args = [1, false] elsif @operation == :commit @args[0] += 1 else raise "@operation must be :commit or nil" end self end |
#amend! ⇒ Object
369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/leg/representations/git.rb', line 369 def amend! if @operation.nil? @operation = :commit @args = [0, true] elsif @operation == :commit @args[1] = true else raise "@operation must be :commit or nil" end self end |
#conflict! ⇒ Object
381 382 383 384 |
# File 'lib/leg/representations/git.rb', line 381 def conflict! @conflict = true self end |
#step!(step_number) ⇒ Object
352 353 354 355 |
# File 'lib/leg/representations/git.rb', line 352 def step!(step_number) @step_number = step_number self end |