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
# 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]
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

#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



37
38
39
40
41
# File 'lib/omnibus/manifest_entry.rb', line 37

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

#to_hashObject



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

def to_hash
  {
    "locked_version" => @locked_version,
    "locked_source" => @locked_source,
    "source_type" => @source_type,
    "described_version" => @described_version
  }
end