Class: Jsb3::Package
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(raw_package_hash, resources) ⇒ Package
constructor
A new instance of Package.
- #to_s ⇒ Object
Constructor Details
#initialize(raw_package_hash, resources) ⇒ Package
Returns a new instance of Package.
8 9 10 11 12 13 14 15 |
# File 'lib/jsb3/package.rb', line 8 def initialize(raw_package_hash, resources) @id = raw_package_hash['id'] @name = raw_package_hash['name'] @target = raw_package_hash['target'] @files = raw_package_hash['files'].map do |raw_file| File.new raw_file, resources end end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
6 7 8 |
# File 'lib/jsb3/package.rb', line 6 def files @files end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/jsb3/package.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/jsb3/package.rb', line 6 def name @name end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
6 7 8 |
# File 'lib/jsb3/package.rb', line 6 def target @target end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/jsb3/package.rb', line 17 def to_s "#{@name} has #{@files.count} files." end |