Class: Device::Application
- Inherits:
-
Object
- Object
- Device::Application
- Defined in:
- lib/device/application.rb
Instance Attribute Summary collapse
-
#crc ⇒ Object
readonly
Returns the value of attribute crc.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #execute(json = "") ⇒ Object
- #file ⇒ Object
- #file_no_ext ⇒ Object
-
#initialize(label, file_path, type, crc) ⇒ Application
constructor
A new instance of Application.
- #zip ⇒ Object
Constructor Details
#initialize(label, file_path, type, crc) ⇒ Application
Returns a new instance of Application.
5 6 7 8 9 10 11 |
# File 'lib/device/application.rb', line 5 def initialize(label, file_path, type, crc) @name = label @order, @label = split_label(label) @file_path = file_path @type = type @crc = crc end |
Instance Attribute Details
#crc ⇒ Object (readonly)
Returns the value of attribute crc.
3 4 5 |
# File 'lib/device/application.rb', line 3 def crc @crc end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
3 4 5 |
# File 'lib/device/application.rb', line 3 def file_path @file_path end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/device/application.rb', line 3 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/device/application.rb', line 3 def name @name end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
3 4 5 |
# File 'lib/device/application.rb', line 3 def order @order end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/device/application.rb', line 3 def type @type end |
Instance Method Details
#execute(json = "") ⇒ Object
25 26 27 |
# File 'lib/device/application.rb', line 25 def execute(json = "") Device::Runtime.execute(file_no_ext, json) end |
#file ⇒ Object
13 14 15 |
# File 'lib/device/application.rb', line 13 def file @file ||= file_path.gsub("#{Device::Setting.company_name}_", "") end |
#file_no_ext ⇒ Object
17 18 19 |
# File 'lib/device/application.rb', line 17 def file_no_ext @file_no_ext ||= file.split(".")[0] end |
#zip ⇒ Object
21 22 23 |
# File 'lib/device/application.rb', line 21 def zip @zip ||= "#{file_no_ext}.zip" end |