Add TODOs to refactoried variables collections code

This commit is contained in:
Grzegorz Bizon 2018-03-12 15:09:19 +01:00
parent b94db067b7
commit a4a29e2ee1
2 changed files with 5 additions and 0 deletions

View file

@ -14,6 +14,7 @@ module Gitlab
@variables.append(Collection::Item.fabricate(resource))
end
# TODO, specs
def concat(resources)
resources.each { |variable| self.append(variable) }
end

View file

@ -3,6 +3,8 @@ module Gitlab
module Variables
class Collection
class Item
# TODO, public by default?
#
def initialize(**options)
@variable = {
key: options.fetch(:key),
@ -28,6 +30,8 @@ module Gitlab
end
def self.fabricate(resource)
# TODO, to_runner_variable by default for class < ActiveRecord::Base
#
case resource
when Hash
self.new(resource)