Class: Blockchain::Transaction::Output

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(o) ⇒ Output



53
54
55
56
# File 'lib/transaction.rb', line 53

def initialize(o)
  o.each_key { |k| instance_variable_set"@#{k}", o[k] }
  @value = Btc.from_satoshis(@value)
end

Instance Attribute Details

#addrObject (readonly)

Returns the value of attribute addr.



51
52
53
# File 'lib/transaction.rb', line 51

def addr
  @addr
end

#nObject (readonly)

Returns the value of attribute n.



51
52
53
# File 'lib/transaction.rb', line 51

def n
  @n
end

#scriptObject (readonly)

Returns the value of attribute script.



51
52
53
# File 'lib/transaction.rb', line 51

def script
  @script
end

#spentObject (readonly)

Returns the value of attribute spent.



51
52
53
# File 'lib/transaction.rb', line 51

def spent
  @spent
end

#tx_indexObject (readonly)

Returns the value of attribute tx_index.



51
52
53
# File 'lib/transaction.rb', line 51

def tx_index
  @tx_index
end

#typeObject (readonly)

Returns the value of attribute type.



51
52
53
# File 'lib/transaction.rb', line 51

def type
  @type
end