Class: SteemData::Post

Inherits:
Object
  • Object
show all
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

included

Methods included from ActsAsMathematical

included

Class Method Details

.find_flag_warObject



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(options = {})
  options[:author.in] ||= distinct(:author)
  options[:permlink.in] ||= distinct(:permlink)
  options[:voter.in] ||= distinct('active_votes.voter')
  
  AccountOperation.type('vote').where(options).distinct(:voter)
end

Instance Method Details

#commented_on?(name, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
53
54
55
56
# File 'lib/steem_data/post.rb', line 50

def commented_on?(name, options = {})
  replies.map do |reply|
    false if !!options[:min_reputation] && reply['author_reputation'].to_i < options[:min_reputation]
    
    reply['author'] == name
  end.uniq.include? true
end

#pending_payout?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/steem_data/post.rb', line 58

def pending_payout?
  cashout_time > Time.now.utc
end