Class: Gemview::Gem::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/gemview/gem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Version

Returns a new instance of Version.

Parameters:

  • options (Hash)


68
69
70
71
72
73
# File 'lib/gemview/gem.rb', line 68

def initialize(options)
  @version = options.fetch("number")
  @downloads = options.fetch("downloads_count")
  @release_date = Date.parse(options.fetch("created_at"))
  @ruby_version = options.fetch("ruby_version") || "(unknown)"
end

Instance Attribute Details

#downloadsObject (readonly)

Returns the value of attribute downloads.



65
66
67
# File 'lib/gemview/gem.rb', line 65

def downloads
  @downloads
end

#release_dateObject (readonly)

Returns the value of attribute release_date.



65
66
67
# File 'lib/gemview/gem.rb', line 65

def release_date
  @release_date
end

#ruby_versionObject (readonly)

Returns the value of attribute ruby_version.



65
66
67
# File 'lib/gemview/gem.rb', line 65

def ruby_version
  @ruby_version
end

#versionObject (readonly)

Returns the value of attribute version.



65
66
67
# File 'lib/gemview/gem.rb', line 65

def version
  @version
end