Class: Plum::ContentSourceContext
- Inherits:
-
Object
- Object
- Plum::ContentSourceContext
- Defined in:
- lib/plum/content_source_context.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
- #current_user ⇒ Object
-
#initialize(controller:, site:) ⇒ ContentSourceContext
constructor
A new instance of ContentSourceContext.
- #owner ⇒ Object
- #params ⇒ Object
- #request ⇒ Object
- #session ⇒ Object
Constructor Details
#initialize(controller:, site:) ⇒ ContentSourceContext
Returns a new instance of ContentSourceContext.
5 6 7 8 |
# File 'lib/plum/content_source_context.rb', line 5 def initialize(controller:, site:) @controller = controller @site = site end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
3 4 5 |
# File 'lib/plum/content_source_context.rb', line 3 def controller @controller end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
3 4 5 |
# File 'lib/plum/content_source_context.rb', line 3 def site @site end |
Instance Method Details
#current_user ⇒ Object
22 23 24 |
# File 'lib/plum/content_source_context.rb', line 22 def current_user controller.send(:current_user) if controller.respond_to?(:current_user, true) end |
#owner ⇒ Object
26 27 28 |
# File 'lib/plum/content_source_context.rb', line 26 def owner site.owner if site.respond_to?(:owner) end |
#params ⇒ Object
14 15 16 |
# File 'lib/plum/content_source_context.rb', line 14 def params controller.params end |
#request ⇒ Object
10 11 12 |
# File 'lib/plum/content_source_context.rb', line 10 def request controller.request end |
#session ⇒ Object
18 19 20 |
# File 'lib/plum/content_source_context.rb', line 18 def session controller.session end |