class Simp::Metadata::Buildinfo

Attributes

component[RW]
type[RW]

Public Class Methods

new(component, type) click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 8
def initialize(component, type)
  @type = type
  @component = component
end

Public Instance Methods

[](index) click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 17
def [](index)
  send index.to_sym
end
build_method() click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 39
def build_method
  buildinfo = fetch_data
  if buildinfo.nil?
    retval = method_defaults[type]['build_method']
  else
    if buildinfo.key?(type)
      retval = if buildinfo[type].key?('build_method')
                 buildinfo[type]['build_method']
               else
                 method_defaults[type]['build_method']
               end
    else
      retval = method_defaults[type]['build_method']
    end
  end
  retval
end
each() { |key, self| ... } click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 21
def each
  keys.each do |key|
    yield key, self[key]
  end
end
fetch_data() click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 27
def fetch_data
  component.fetch_data('buildinfo')
end
keys() click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 13
def keys
  %w(type build_method)
end
method_defaults() click to toggle source
# File lib/simp/metadata/buildinfo.rb, line 31
def method_defaults
  {
    'rpm' => {
      'build_method' => 'simp-core'
    }
  }
end