debian-mirror-gitlab/lib/gitlab/ci/config/node/attributable.rb

24 lines
490 B
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
module Gitlab
module Ci
class Config
module Node
module Attributable
extend ActiveSupport::Concern
class_methods do
def attributes(*attributes)
attributes.flatten.each do |attribute|
define_method(attribute) do
return unless config.is_a?(Hash)
config[attribute]
end
end
end
end
end
end
end
end
end