Class: EmuCtl::Target
- Inherits:
-
Object
- Object
- EmuCtl::Target
- Defined in:
- lib/emu_ctl/model.rb
Instance Attribute Summary collapse
-
#abi ⇒ Object
Returns the value of attribute abi.
-
#api_lvl ⇒ Object
Returns the value of attribute api_lvl.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#skins ⇒ Object
Returns the value of attribute skins.
Instance Method Summary collapse
-
#initialize(desc) ⇒ Target
constructor
A new instance of Target.
- #to_s ⇒ Object
Constructor Details
#initialize(desc) ⇒ Target
Returns a new instance of Target.
6 7 8 9 10 11 12 13 14 |
# File 'lib/emu_ctl/model.rb', line 6 def initialize(desc) @lines = desc.split("\n") @id = /id: \d+ .* "(.+)"/.match(desc)[1] @name = /Name: (.+)/.match(desc)[1] @skins = /Skins: (.*)/.match(desc)[1].split(',').map{|n| n.strip} @abi = /ABIs : (.+)/.match(desc)[1] @abi = nil if @abi.include?('no ABIs.') @api_lvl = /API level.? (\d+)/.match(desc)[1].to_i end |
Instance Attribute Details
#abi ⇒ Object
Returns the value of attribute abi.
4 5 6 |
# File 'lib/emu_ctl/model.rb', line 4 def abi @abi end |
#api_lvl ⇒ Object
Returns the value of attribute api_lvl.
4 5 6 |
# File 'lib/emu_ctl/model.rb', line 4 def api_lvl @api_lvl end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/emu_ctl/model.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/emu_ctl/model.rb', line 4 def name @name end |
#skins ⇒ Object
Returns the value of attribute skins.
4 5 6 |
# File 'lib/emu_ctl/model.rb', line 4 def skins @skins end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/emu_ctl/model.rb', line 16 def to_s "#{@id}\n\tName: #{@name}\n\t#{@skins}\n\tABI: #{abi}" end |