Module: Radiator::Mixins::ActsAsVoter
- Included in:
- Chain
- Defined in:
- lib/radiator/mixins/acts_as_voter.rb
Instance Method Summary collapse
-
#vote(weight, *args) ⇒ Object
Create a vote operation.
-
#vote!(weight, *args) ⇒ Object
Create a vote operation and broadcasts it right away.
Instance Method Details
#vote(weight, *args) ⇒ Object
Create a vote operation.
Examples:
steem = Radiator::Chain.new(chain: :steem, account_name: 'your account name', wif: 'your wif')
steem.vote(10000, 'author', 'permlink')
steem.broadcast!
… or …
steem = Radiator::Chain.new(chain: :steem, account_name: 'your account name', wif: 'your wif')
steem.vote(10000, '@author/permlink')
steem.broadcast!
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/radiator/mixins/acts_as_voter.rb', line 20 def vote(weight, *args) , permlink = (args) @operations << { type: :vote, voter: account_name, author: , permlink: permlink, weight: weight } self end |
#vote!(weight, *args) ⇒ Object
Create a vote operation and broadcasts it right away.
Examples:
steem = Radiator::Chain.new(chain: :steem, account_name: 'your account name', wif: 'your wif')
steem.vote!(10000, 'author', 'permlink')
… or …
steem = Radiator::Chain.new(chain: :steem, account_name: 'your account name', wif: 'your wif')
steem.vote!(10000, '@author/permlink')
47 |
# File 'lib/radiator/mixins/acts_as_voter.rb', line 47 def vote!(weight, *args); vote(weight, *args).broadcast!(true); end |