Class: MojComponent::AlertComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/moj_component/alert_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, heading:, body:, dismiss_href:, dismiss_text: "Dismiss", dismiss_method: :post) ⇒ AlertComponent

Returns a new instance of AlertComponent.



12
13
14
15
16
17
18
19
20
# File 'app/components/moj_component/alert_component.rb', line 12

def initialize(type:, heading:, body:, dismiss_href:, dismiss_text: "Dismiss", dismiss_method: :post)
  @type = check_type(type)
  @heading = heading
  @body = body
  @dismiss_href = dismiss_href
  @dismiss_text = dismiss_text
  @dismiss_method = dismiss_method
  super()
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'app/components/moj_component/alert_component.rb', line 5

def body
  @body
end

#dismiss_hrefObject (readonly)

Returns the value of attribute dismiss_href.



5
6
7
# File 'app/components/moj_component/alert_component.rb', line 5

def dismiss_href
  @dismiss_href
end

#dismiss_methodObject (readonly)

Returns the value of attribute dismiss_method.



5
6
7
# File 'app/components/moj_component/alert_component.rb', line 5

def dismiss_method
  @dismiss_method
end

#dismiss_textObject (readonly)

Returns the value of attribute dismiss_text.



5
6
7
# File 'app/components/moj_component/alert_component.rb', line 5

def dismiss_text
  @dismiss_text
end

#headingObject (readonly)

Returns the value of attribute heading.



5
6
7
# File 'app/components/moj_component/alert_component.rb', line 5

def heading
  @heading
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'app/components/moj_component/alert_component.rb', line 5

def type
  @type
end