Class: Jsb3::Package

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/jsb3/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filesObject (readonly)

Returns the value of attribute files.



6
7
8
# File 'lib/jsb3/package.rb', line 6

def files
  @files
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/jsb3/package.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/jsb3/package.rb', line 6

def name
  @name
end

#targetObject (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_sObject



17
18
19
# File 'lib/jsb3/package.rb', line 17

def to_s
  "#{@name} has #{@files.count} files."
end