Class: Noticent::Channel
- Inherits:
-
Object
- Object
- Noticent::Channel
- Defined in:
- lib/noticent/channel.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(config, recipients, payload, configuration) ⇒ Channel
constructor
A new instance of Channel.
- #render_within_context(template:, content:, context:) ⇒ Object
Constructor Details
#initialize(config, recipients, payload, configuration) ⇒ Channel
Returns a new instance of Channel.
10 11 12 13 14 15 16 17 |
# File 'lib/noticent/channel.rb', line 10 def initialize(config, recipients, payload, configuration) @config = config @recipients = recipients @payload = payload @configuration = configuration @current_user = payload.current_user if payload.respond_to? :current_user @routes = Rails.application.routes.url_helpers end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/noticent/channel.rb', line 8 def data @data end |
Instance Method Details
#render_within_context(template:, content:, context:) ⇒ Object
19 20 21 22 |
# File 'lib/noticent/channel.rb', line 19 def render_within_context(template:, content:, context:) @content = ERB.new(content).result(context) template.nil? ? @content : ERB.new(template).result(binding) end |