Class: Auctify::BidsAppender
- Inherits:
-
ServiceBase
- Object
- ServiceBase
- Auctify::BidsAppender
- Defined in:
- app/services/auctify/bids_appender.rb
Instance Attribute Summary collapse
-
#auction ⇒ Object
readonly
Returns the value of attribute auction.
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
Attributes inherited from ServiceBase
Instance Method Summary collapse
- #build_result ⇒ Object
-
#initialize(auction:, bid: nil) ⇒ BidsAppender
constructor
A new instance of BidsAppender.
Methods inherited from ServiceBase
call, #call, #fail!, #failure?, #success?
Constructor Details
#initialize(auction:, bid: nil) ⇒ BidsAppender
Returns a new instance of BidsAppender.
7 8 9 10 11 12 |
# File 'app/services/auctify/bids_appender.rb', line 7 def initialize(auction:, bid: nil) super() @auction = auction @bid = bid end |
Instance Attribute Details
#auction ⇒ Object (readonly)
Returns the value of attribute auction.
5 6 7 |
# File 'app/services/auctify/bids_appender.rb', line 5 def auction @auction end |
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
5 6 7 |
# File 'app/services/auctify/bids_appender.rb', line 5 def bid @bid end |
Instance Method Details
#build_result ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/services/auctify/bids_appender.rb', line 14 def build_result self.current_price = auction.current_price @updated_win_bid = nil if bid set_price_for_limit_bid if approved_bid? solve_winner(winning_bid, bid) append_bids! update_auction! unless failed? else fail! end end @result = result_struct end |