Class: Recruiter::ShowHelper::AttributeShower

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/recruiter/show_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#helperObject (readonly)

Returns the value of attribute helper.



10
11
12
# File 'app/helpers/recruiter/show_helper.rb', line 10

def helper
  @helper
end

#objectObject (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