Class: Gitlab::View::Presenter::Simple

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/gitlab/view/presenter/simple.rb

Instance Attribute Summary

Attributes included from Base

#subject

Instance Method Summary collapse

Methods included from Base

#can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path, #web_url

Methods included from Allowable

#can?

Methods included from Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

#initialize(subject, **attributes) ⇒ Simple

Returns a new instance of Simple.


9
10
11
12
13
14
15
# File 'lib/gitlab/view/presenter/simple.rb', line 9

def initialize(subject, **attributes)
  @subject = subject

  attributes.each do |key, value|
    define_singleton_method(key) { value }
  end
end