Class: Icarus::Mod::Tools::Toolinfo

Inherits:
Baseinfo
  • Object
show all
Defined in:
lib/icarus/mod/tools/toolinfo.rb

Overview

Sync methods

Constant Summary collapse

HASHKEYS =
%i[name author version compatibility description fileType fileURL imageURL readmeURL].freeze

Instance Attribute Summary

Attributes inherited from Baseinfo

#created_at, #data, #id, #updated_at

Instance Method Summary collapse

Methods inherited from Baseinfo

#author_id, #errors, #errors?, #file_types, #file_urls, #initialize, #method_missing, #read, #respond_to_missing?, #status, #to_json, #uniq_name, #valid?, #warnings, #warnings?

Constructor Details

This class inherits a constructor from Icarus::Mod::Tools::Baseinfo

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Icarus::Mod::Tools::Baseinfo

Instance Method Details

#fileTypeObject

rubocop:disable Naming/MethodName



13
14
15
# File 'lib/icarus/mod/tools/toolinfo.rb', line 13

def fileType
  @data[:fileType] || "zip"
end

#to_hObject

rubocop:enable Naming/MethodName



18
19
20
# File 'lib/icarus/mod/tools/toolinfo.rb', line 18

def to_h
  HASHKEYS.each_with_object({}) { |key, hash| hash[key] = @data[key] }
end