Sha256: c41f0e5762e44e139af607af6920bab90a5c046c9e08a26228d755c8123c2152
Contents?: true
Size: 935 Bytes
Versions: 1
Compression:
Stored size: 935 Bytes
Contents
module Katello class RepositoryType class << self def def_field(*names) class_eval do names.each do |name| define_method(name) do |*args| args.empty? ? instance_variable_get("@#{name}") : instance_variable_set("@#{name}", *args) end end end end end def_field :allow_creation_by_user, :service_class attr_accessor :metadata_publish_matching_check attr_reader :id def initialize(id) @id = id.to_sym allow_creation_by_user(true) end def prevent_unneeded_metadata_publish self.metadata_publish_matching_check = true end def <=>(other) self.id.to_s <=> other.id.to_s end def as_json(options = {}) ret = super(options) ret[:name] = self.id.to_s ret[:creatable] = @allow_creation_by_user ret.delete("allow_creation_by_user") ret end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
katello-3.11.0.rc1 | app/services/katello/repository_type.rb |