Class: SteemData::Post
- Inherits:
-
Object
- Object
- SteemData::Post
- Includes:
- Mongoid::Attributes::Dynamic, Mongoid::Document, ActsAsMathematical, ActsAsTemporal
- Defined in:
- lib/steem_data/post.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ActsAsTemporal
Methods included from ActsAsMathematical
Class Method Details
.find_flag_war ⇒ Object
39 40 |
# File 'lib/steem_data/post.rb', line 39 def self.find_flag_war end |
.voters(options = {}) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/steem_data/post.rb', line 42 def self.voters( = {}) [:author.in] ||= distinct(:author) [:permlink.in] ||= distinct(:permlink) [:voter.in] ||= distinct('active_votes.voter') AccountOperation.type('vote').where().distinct(:voter) end |
Instance Method Details
#commented_on?(name, options = {}) ⇒ Boolean
50 51 52 53 54 55 56 |
# File 'lib/steem_data/post.rb', line 50 def commented_on?(name, = {}) replies.map do |reply| false if !![:min_reputation] && reply['author_reputation'].to_i < [:min_reputation] reply['author'] == name end.uniq.include? true end |
#pending_payout? ⇒ Boolean
58 59 60 |
# File 'lib/steem_data/post.rb', line 58 def pending_payout? cashout_time > Time.now.utc end |