Class: Brocade::SAN::Provisioning::Agent::Transaction

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

Overview

simple Transaction class that processes Switch#cfg_transaction output

Value of id means:

:id

-1 - no transaction exist

nil - unexpected result

string - string representation of current transaction id

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Transaction

takes hash returned by cfg_transaction command



864
865
866
867
868
869
870
# File 'lib/brocadesan/provisioning.rb', line 864

def initialize(opts={}) #:nodoc:
  # empty hash means unexpected result of cfg_transaction
  if [:id, :abortable].all? {|k| opts.key? k}
    @id = opts[:id]
    @abortable = opts[:abortable]
  end
end

Instance Attribute Details

#abortable=(value) ⇒ Object (writeonly)

Sets the attribute abortable

Parameters:

  • value

    the value to set the attribute abortable to.



859
860
861
# File 'lib/brocadesan/provisioning.rb', line 859

def abortable=(value)
  @abortable = value
end

#idObject

Specifies the id of Transaction



861
862
863
# File 'lib/brocadesan/provisioning.rb', line 861

def id
  @id
end

Instance Method Details

#abortable?Boolean

Returns abortable flag

Returns:

  • (Boolean)


873
874
875
# File 'lib/brocadesan/provisioning.rb', line 873

def abortable?
  @abortable
end