Class: RubyHackernews::VotingInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-hackernews/domain/entry/voting_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score, upvote, downvote) ⇒ VotingInfo

Returns a new instance of VotingInfo.



9
10
11
12
13
# File 'lib/ruby-hackernews/domain/entry/voting_info.rb', line 9

def initialize(score, upvote, downvote)
  @score    =  score
  @upvote   = upvote
  @downvote = downvote
end

Instance Attribute Details

#downvoteObject (readonly)

Returns the value of attribute downvote.



7
8
9
# File 'lib/ruby-hackernews/domain/entry/voting_info.rb', line 7

def downvote
  @downvote
end

#scoreObject (readonly)

Returns the value of attribute score.



5
6
7
# File 'lib/ruby-hackernews/domain/entry/voting_info.rb', line 5

def score
  @score
end

#upvoteObject (readonly)

Returns the value of attribute upvote.



6
7
8
# File 'lib/ruby-hackernews/domain/entry/voting_info.rb', line 6

def upvote
  @upvote
end