2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Packages
|
|
|
|
module Npm
|
|
|
|
class PackagePresenter
|
2023-06-20 00:43:36 +05:30
|
|
|
def initialize(metadata)
|
|
|
|
@metadata = metadata
|
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
def name
|
|
|
|
metadata[:name]
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def versions
|
2023-06-20 00:43:36 +05:30
|
|
|
metadata[:versions]
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def dist_tags
|
2023-06-20 00:43:36 +05:30
|
|
|
metadata[:dist_tags]
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
attr_reader :metadata
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|