Class: PluginDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/decorators/plugin_decorator.rb

Instance Method Summary collapse

Instance Method Details

#statusObject



4
5
6
7
8
9
10
11
12
# File 'app/decorators/plugin_decorator.rb', line 4

def status
  if processing?
    I18n.t("terms.processing")
  elsif installed?
    I18n.t("terms.installed")
  else
    I18n.t("terms.not_installed")
  end
end

#to_hashObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/decorators/plugin_decorator.rb', line 14

def to_hash
  {
    is_installed: installed?,
    is_processing: processing?,
    uninstall_button: "plugin-modal-#{gem_name}",
    name: gem_name,
    authors: authors,
    summary: summary,
    api_version: api_version,
    category: category,
    status: status,
    installed_version: installed_version,
    latest_version: latest_version,
    is_latest_version: latest_version?,
    rubygems_org_page: rubygems_org_page
  }
end