Class: Recruiter::ShowHelper::AttributeShower
- Inherits:
-
Object
- Object
- Recruiter::ShowHelper::AttributeShower
- Defined in:
- app/helpers/recruiter/show_helper.rb
Instance Attribute Summary collapse
-
#helper ⇒ Object
readonly
Returns the value of attribute helper.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(object, helper) ⇒ AttributeShower
constructor
A new instance of AttributeShower.
- #render(label, value) ⇒ Object
- #show(attribute) ⇒ Object
Constructor Details
#initialize(object, helper) ⇒ AttributeShower
Returns a new instance of AttributeShower.
12 13 14 15 |
# File 'app/helpers/recruiter/show_helper.rb', line 12 def initialize(object, helper) @object = object @helper = helper end |
Instance Attribute Details
#helper ⇒ Object (readonly)
Returns the value of attribute helper.
10 11 12 |
# File 'app/helpers/recruiter/show_helper.rb', line 10 def helper @helper end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
10 11 12 |
# File 'app/helpers/recruiter/show_helper.rb', line 10 def object @object end |
Instance Method Details
#render(label, value) ⇒ Object
24 25 26 |
# File 'app/helpers/recruiter/show_helper.rb', line 24 def render(label, value) helper.render('application/show_item', label: label, value: value) end |
#show(attribute) ⇒ Object
17 18 19 20 21 22 |
# File 'app/helpers/recruiter/show_helper.rb', line 17 def show(attribute) render( object.class.human_attribute_name(attribute), object.send(attribute) ) end |