Class: Auctify::Configuration
- Inherits:
-
Object
- Object
- Auctify::Configuration
- Defined in:
- lib/auctify/configuration.rb
Instance Attribute Summary collapse
-
#allow_changes_on_auction_with_bids_for_attributes ⇒ Object
Returns the value of attribute allow_changes_on_auction_with_bids_for_attributes.
-
#auction_prolonging_limit_in_seconds ⇒ Object
Returns the value of attribute auction_prolonging_limit_in_seconds.
-
#auctioneer_commission_in_percent ⇒ Object
Returns the value of attribute auctioneer_commission_in_percent.
-
#autofinish_auction_after_bidding ⇒ Object
Returns the value of attribute autofinish_auction_after_bidding.
-
#autoregister_as_bidders_all_instances_of_classes ⇒ Object
Returns the value of attribute autoregister_as_bidders_all_instances_of_classes.
-
#default_bid_steps_ladder ⇒ Object
Returns the value of attribute default_bid_steps_ladder.
-
#require_bids_to_be_rounded_to ⇒ Object
Returns the value of attribute require_bids_to_be_rounded_to.
-
#restrict_overbidding_yourself_to_max_price_increasing ⇒ Object
Returns the value of attribute restrict_overbidding_yourself_to_max_price_increasing.
-
#when_to_notify_bidders_before_end_of_bidding ⇒ Object
Returns the value of attribute when_to_notify_bidders_before_end_of_bidding.
Instance Method Summary collapse
- #autoregistering_for?(instance) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/auctify/configuration.rb', line 16 def initialize # set defaults here @autoregister_as_bidders_all_instances_of_classes = [] @auction_prolonging_limit_in_seconds = 2.minutes @auctioneer_commission_in_percent = 1 # % @autofinish_auction_after_bidding = false @when_to_notify_bidders_before_end_of_bidding = nil # no notifying @default_bid_steps_ladder = { 0.. => 1 } @restrict_overbidding_yourself_to_max_price_increasing = true @require_bids_to_be_rounded_to = 1 @allow_changes_on_auction_with_bids_for_attributes = [] end |
Instance Attribute Details
#allow_changes_on_auction_with_bids_for_attributes ⇒ Object
Returns the value of attribute allow_changes_on_auction_with_bids_for_attributes.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def allow_changes_on_auction_with_bids_for_attributes @allow_changes_on_auction_with_bids_for_attributes end |
#auction_prolonging_limit_in_seconds ⇒ Object
Returns the value of attribute auction_prolonging_limit_in_seconds.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def auction_prolonging_limit_in_seconds @auction_prolonging_limit_in_seconds end |
#auctioneer_commission_in_percent ⇒ Object
Returns the value of attribute auctioneer_commission_in_percent.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def auctioneer_commission_in_percent @auctioneer_commission_in_percent end |
#autofinish_auction_after_bidding ⇒ Object
Returns the value of attribute autofinish_auction_after_bidding.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def autofinish_auction_after_bidding @autofinish_auction_after_bidding end |
#autoregister_as_bidders_all_instances_of_classes ⇒ Object
Returns the value of attribute autoregister_as_bidders_all_instances_of_classes.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def autoregister_as_bidders_all_instances_of_classes @autoregister_as_bidders_all_instances_of_classes end |
#default_bid_steps_ladder ⇒ Object
Returns the value of attribute default_bid_steps_ladder.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def default_bid_steps_ladder @default_bid_steps_ladder end |
#require_bids_to_be_rounded_to ⇒ Object
Returns the value of attribute require_bids_to_be_rounded_to.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def require_bids_to_be_rounded_to @require_bids_to_be_rounded_to end |
#restrict_overbidding_yourself_to_max_price_increasing ⇒ Object
Returns the value of attribute restrict_overbidding_yourself_to_max_price_increasing.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def restrict_overbidding_yourself_to_max_price_increasing @restrict_overbidding_yourself_to_max_price_increasing end |
#when_to_notify_bidders_before_end_of_bidding ⇒ Object
Returns the value of attribute when_to_notify_bidders_before_end_of_bidding.
5 6 7 |
# File 'lib/auctify/configuration.rb', line 5 def when_to_notify_bidders_before_end_of_bidding @when_to_notify_bidders_before_end_of_bidding end |
Instance Method Details
#autoregistering_for?(instance) ⇒ Boolean
29 30 31 32 33 |
# File 'lib/auctify/configuration.rb', line 29 def autoregistering_for?(instance) return false if instance.blank? autoregister_as_bidders_all_instances_of_classes.include?(instance.class.name) end |