Module: Net::DND::Expires
- Defined in:
- lib/net/dnd/expires.rb
Overview
Set of methods that are conditionally added to the Profile class, when the “expires” field has been specified.
Instance Method Summary collapse
Instance Method Details
#expire_days ⇒ Object
14 15 16 |
# File 'lib/net/dnd/expires.rb', line 14 def expire_days (expires_on - Date.today).to_i rescue nil end |
#expired? ⇒ Boolean
18 19 20 21 |
# File 'lib/net/dnd/expires.rb', line 18 def expired? expire_days.nil? and return false expire_days < 1 ? true : false end |
#expires_on ⇒ Object
10 11 12 |
# File 'lib/net/dnd/expires.rb', line 10 def expires_on @expires_date ||= Date.parse(expires) rescue nil end |