Class: AppInfo::File
- Inherits:
-
Object
- Object
- AppInfo::File
- Defined in:
- lib/app_info/file.rb
Direct Known Subclasses
Android, Apple, DSYM, HarmonyOS, InfoPlist, MobileProvision, PE, PackInfo, Proguard
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #device ⇒ Object abstract
- #format ⇒ Symbol
-
#initialize(file, logger: AppInfo.logger) ⇒ File
constructor
A new instance of File.
- #manufacturer ⇒ Object abstract
- #not_implemented_error!(method) ⇒ Object
- #platform ⇒ Object abstract
- #size(human_size: false) ⇒ Object abstract
Constructor Details
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/app_info/file.rb', line 6 def file @file end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/app_info/file.rb', line 6 def logger @logger end |
Instance Method Details
#device ⇒ Object
This method is abstract.
Subclass and override #device to implement.
36 37 38 |
# File 'lib/app_info/file.rb', line 36 def device not_implemented_error!(__method__) end |
#format ⇒ Symbol
Returns AppInfo::Format.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/app_info/file.rb', line 14 def format @format ||= lambda { if instance_of?(AppInfo::File) || instance_of?(AppInfo::Apple) || instance_of?(AppInfo::Android) not_implemented_error!(__method__) end self.class.name.split('::')[-1].downcase.to_sym }.call end |
#manufacturer ⇒ Object
This method is abstract.
Subclass and override #manufacturer to implement.
31 32 33 |
# File 'lib/app_info/file.rb', line 31 def manufacturer not_implemented_error!(__method__) end |
#not_implemented_error!(method) ⇒ Object
45 46 47 |
# File 'lib/app_info/file.rb', line 45 def not_implemented_error!(method) raise NotImplementedError, ".#{method} method implantation required in #{self.class}" end |
#platform ⇒ Object
This method is abstract.
Subclass and override #platform to implement.
26 27 28 |
# File 'lib/app_info/file.rb', line 26 def platform not_implemented_error!(__method__) end |
#size(human_size: false) ⇒ Object
This method is abstract.
Subclass and override #size to implement
41 42 43 |
# File 'lib/app_info/file.rb', line 41 def size(human_size: false) not_implemented_error!(__method__) end |