Welcome to mirror list, hosted at ThFree Co, Russian Federation.

entity_request.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 12ceb38b28469e5bc06594ada78908ff5a9717c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class EntityRequest
  # We use EntityRequest object to collect parameters and variables
  # from the controller. Because options that are being passed to the entity
  # do appear in each entity object  in the chain, we need a way to pass data
  # that is present in the controller (see  #20045).
  #
  def initialize(parameters)
    merge!(parameters)
  end

  def merge!(parameters)
    parameters.each do |key, value|
      define_singleton_method(key) { value }
    end
  end
end