Class: Georgia::WarningMessage

Inherits:
Presenter show all
Defined in:
app/presenters/georgia/warning_message.rb

Instance Attribute Summary collapse

Attributes inherited from Presenter

#view_context

Instance Method Summary collapse

Constructor Details

#initialize(view_context, page, revision, options = {}) ⇒ WarningMessage

Returns a new instance of WarningMessage.



6
7
8
9
10
11
# File 'app/presenters/georgia/warning_message.rb', line 6

def initialize view_context, page, revision, options={}
  @page = page
  @revision = revision
  @options = options
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Georgia::Presenter

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'app/presenters/georgia/warning_message.rb', line 4

def options
  @options
end

#pageObject (readonly)

Returns the value of attribute page.



4
5
6
# File 'app/presenters/georgia/warning_message.rb', line 4

def page
  @page
end

#revisionObject (readonly)

Returns the value of attribute revision.



4
5
6
# File 'app/presenters/georgia/warning_message.rb', line 4

def revision
  @revision
end

Instance Method Details

#to_sObject



13
14
15
16
17
18
19
# File 'app/presenters/georgia/warning_message.rb', line 13

def to_s
  return nil unless message
  html = ActiveSupport::SafeBuffer.new
  html << warning_icon_tag
  html << message
  (:div, (:p, html), class: 'warning-message')
end