Class: Bitcoin::Builder::TxOutBuilder
- Inherits:
-
Object
- Object
- Bitcoin::Builder::TxOutBuilder
- Defined in:
- lib/bitcoin/builder.rb
Overview
create a Bitcoin::Protocol::TxOut used by TxBuilder#output.
Instance Attribute Summary collapse
-
#txout ⇒ Object
readonly
Returns the value of attribute txout.
Instance Method Summary collapse
-
#initialize ⇒ TxOutBuilder
constructor
A new instance of TxOutBuilder.
-
#script {|c| ... } ⇒ Object
add a script to the output (see ScriptBuilder).
-
#value(value) ⇒ Object
set output value (in base units / “satoshis”).
Constructor Details
#initialize ⇒ TxOutBuilder
Returns a new instance of TxOutBuilder.
273 274 275 |
# File 'lib/bitcoin/builder.rb', line 273 def initialize @txout = P::TxOut.new end |
Instance Attribute Details
#txout ⇒ Object (readonly)
Returns the value of attribute txout.
271 272 273 |
# File 'lib/bitcoin/builder.rb', line 271 def txout @txout end |
Instance Method Details
#script {|c| ... } ⇒ Object
add a script to the output (see ScriptBuilder).
283 284 285 286 287 |
# File 'lib/bitcoin/builder.rb', line 283 def script &block c = ScriptBuilder.new yield c @txout.pk_script = c.script end |
#value(value) ⇒ Object
set output value (in base units / “satoshis”)
278 279 280 |
# File 'lib/bitcoin/builder.rb', line 278 def value value @txout.value = value end |