Class: RepomdParser::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/repomd_parser/reference.rb

Overview

repomd_parser – Ruby gem to parse RPM repository metadata Copyright © 2018 Ivan Kapelyukhin, SUSE Linux GmbH

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location:, checksum_type:, checksum:, type:, size:, arch: nil, version: nil, release: nil, name: nil, summary: nil, description: nil, license: nil, build_time: nil) ⇒ Reference

Returns a new instance of Reference.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/repomd_parser/reference.rb', line 33

def initialize(location:,
               checksum_type:,
               checksum:,
               type:,
               size:,
               arch: nil,
               version: nil,
               release: nil,
               name: nil,
               summary: nil,
               description: nil,
               license: nil,
               build_time: nil)
  local_variables.each do |local_var|
    method = "#{local_var}="
    send(method, binding.local_variable_get(local_var)) if respond_to?(method)
  end
end

Instance Attribute Details

#archObject

Returns the value of attribute arch.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def arch
  @arch
end

#build_timeObject

Returns the value of attribute build_time.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def build_time
  @build_time
end

#checksumObject

Returns the value of attribute checksum.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def checksum
  @checksum
end

#checksum_typeObject

Returns the value of attribute checksum_type.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def checksum_type
  @checksum_type
end

#descriptionObject

Returns the value of attribute description.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def description
  @description
end

#licenseObject

Returns the value of attribute license.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def license
  @license
end

#locationObject

Returns the value of attribute location.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def location
  @location
end

#nameObject

Returns the value of attribute name.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def name
  @name
end

#releaseObject

Returns the value of attribute release.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def release
  @release
end

#sizeObject

Returns the value of attribute size.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def size
  @size
end

#summaryObject

Returns the value of attribute summary.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def summary
  @summary
end

#typeObject

Returns the value of attribute type.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def type
  @type
end

#versionObject

Returns the value of attribute version.



19
20
21
# File 'lib/repomd_parser/reference.rb', line 19

def version
  @version
end

Instance Method Details

#==(other) ⇒ Object

Overloaded comparator for specs



53
54
55
56
57
58
59
# File 'lib/repomd_parser/reference.rb', line 53

def ==(other)
  result = true
  instance_variables.each do |instance_var|
    result &&= (instance_variable_get(instance_var) == other.instance_variable_get(instance_var))
  end
  result
end