Class: EOL::Models::Cycle
- Inherits:
-
Object
- Object
- EOL::Models::Cycle
- Defined in:
- lib/eol_rb/models/cycle.rb
Overview
EOL Cycle model endoflife.date/docs/api
Instance Attribute Summary collapse
-
#eol ⇒ Object
readonly
Returns the value of attribute eol.
-
#latest ⇒ Object
readonly
Returns the value of attribute latest.
-
#latest_release_date ⇒ Object
readonly
Returns the value of attribute latest_release_date.
-
#lts ⇒ Object
readonly
Returns the value of attribute lts.
-
#release_date ⇒ Object
readonly
Returns the value of attribute release_date.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(specs) ⇒ Cycle
constructor
A new instance of Cycle.
- #supported? ⇒ Boolean
Constructor Details
#initialize(specs) ⇒ Cycle
Returns a new instance of Cycle.
9 10 11 12 13 14 15 16 |
# File 'lib/eol_rb/models/cycle.rb', line 9 def initialize(specs) @version = Gem::Version.new(specs.fetch("cycle")) @eol = parse_eol(specs.fetch("eol")) @latest = Gem::Version.new(specs.fetch("latest")) @latest_release_date = Date.parse(specs.fetch("latestReleaseDate")) @release_date = Date.parse(specs.fetch("releaseDate")) @lts = specs.fetch("lts") end |
Instance Attribute Details
#eol ⇒ Object (readonly)
Returns the value of attribute eol.
7 8 9 |
# File 'lib/eol_rb/models/cycle.rb', line 7 def eol @eol end |
#latest ⇒ Object (readonly)
Returns the value of attribute latest.
7 8 9 |
# File 'lib/eol_rb/models/cycle.rb', line 7 def latest @latest end |
#latest_release_date ⇒ Object (readonly)
Returns the value of attribute latest_release_date.
7 8 9 |
# File 'lib/eol_rb/models/cycle.rb', line 7 def latest_release_date @latest_release_date end |
#lts ⇒ Object (readonly)
Returns the value of attribute lts.
7 8 9 |
# File 'lib/eol_rb/models/cycle.rb', line 7 def lts @lts end |
#release_date ⇒ Object (readonly)
Returns the value of attribute release_date.
7 8 9 |
# File 'lib/eol_rb/models/cycle.rb', line 7 def release_date @release_date end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'lib/eol_rb/models/cycle.rb', line 7 def version @version end |
Instance Method Details
#supported? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/eol_rb/models/cycle.rb', line 18 def supported? return !eol if [true, false].include? eol @eol > Time.now.to_date end |