Class: Katello::Pool
- Includes:
- Glue::Candlepin::CandlepinObject, Glue::Candlepin::Pool, Authorization::Pool
- Defined in:
- app/models/katello/pool.rb
Constant Summary collapse
- DAYS_EXPIRING_SOON =
120
- DAYS_RECENTLY_EXPIRED =
30
Instance Attribute Summary collapse
-
#quantity_attached ⇒ Object
Returns the value of attribute quantity_attached.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #expiring_soon? ⇒ Boolean
- #products ⇒ Object
- #quantity_available ⇒ Object
- #recently_expired? ⇒ Boolean
- #type ⇒ Object
Methods inherited from Model
Instance Attribute Details
#quantity_attached ⇒ Object
Returns the value of attribute quantity_attached.
5 6 7 |
# File 'app/models/katello/pool.rb', line 5 def quantity_attached @quantity_attached end |
Instance Method Details
#active? ⇒ Boolean
41 42 43 |
# File 'app/models/katello/pool.rb', line 41 def active? active end |
#expiring_soon? ⇒ Boolean
45 46 47 |
# File 'app/models/katello/pool.rb', line 45 def expiring_soon? (end_date.to_date - Date.today) <= DAYS_EXPIRING_SOON end |
#products ⇒ Object
62 63 64 |
# File 'app/models/katello/pool.rb', line 62 def products self.subscription.products if self.subscription end |
#quantity_available ⇒ Object
53 54 55 56 |
# File 'app/models/katello/pool.rb', line 53 def quantity_available return 0 unless self.quantity && self.consumed self.quantity - self.consumed end |
#recently_expired? ⇒ Boolean
49 50 51 |
# File 'app/models/katello/pool.rb', line 49 def recently_expired? Date.today >= end_date.to_date && (Date.today - end_date.to_date) <= DAYS_RECENTLY_EXPIRED end |
#type ⇒ Object
58 59 60 |
# File 'app/models/katello/pool.rb', line 58 def type self.pool_type end |