Class: Omnibus::ManifestEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/omnibus/manifest_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, manifest_data) ⇒ ManifestEntry

Returns a new instance of ManifestEntry.


20
21
22
23
24
25
26
27
# File 'lib/omnibus/manifest_entry.rb', line 20

def initialize(name, manifest_data)
  @name = name
  @locked_version = manifest_data[:locked_version]
  @locked_source = manifest_data[:locked_source]
  @source_type = manifest_data[:source_type]
  @described_version = manifest_data[:described_version]
  @license = manifest_data[:license]
end

Instance Attribute Details

#described_versionObject (readonly)

Returns the value of attribute described_version


19
20
21
# File 'lib/omnibus/manifest_entry.rb', line 19

def described_version
  @described_version
end

#licenseObject (readonly)

Returns the value of attribute license


19
20
21
# File 'lib/omnibus/manifest_entry.rb', line 19

def license
  @license
end

#locked_sourceObject (readonly)

Returns the value of attribute locked_source


19
20
21
# File 'lib/omnibus/manifest_entry.rb', line 19

def locked_source
  @locked_source
end

#locked_versionObject (readonly)

Returns the value of attribute locked_version


19
20
21
# File 'lib/omnibus/manifest_entry.rb', line 19

def locked_version
  @locked_version
end

#nameObject (readonly)

Returns the value of attribute name


19
20
21
# File 'lib/omnibus/manifest_entry.rb', line 19

def name
  @name
end

#source_typeObject (readonly)

Returns the value of attribute source_type


19
20
21
# File 'lib/omnibus/manifest_entry.rb', line 19

def source_type
  @source_type
end

Instance Method Details

#==(other) ⇒ Object


39
40
41
42
43
# File 'lib/omnibus/manifest_entry.rb', line 39

def ==(other)
  if other.is_a?(ManifestEntry)
    (to_hash == other.to_hash) && (name == other.name)
  end
end

#to_hashObject


29
30
31
32
33
34
35
36
37
# File 'lib/omnibus/manifest_entry.rb', line 29

def to_hash
  {
    locked_version: @locked_version,
    locked_source: @locked_source,
    source_type: @source_type,
    described_version: @described_version,
    license: @license,
  }
end