Class: Interview::PolymorphicAddLink

Inherits:
Control
  • Object
show all
Defined in:
lib/interview/controls/polymorphic_add_link.rb

Overview

todo

Instance Attribute Summary collapse

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods inherited from Control

#ancestors, #build, #build_child, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults

Constructor Details

This class inherits a constructor from Interview::Control

Instance Attribute Details

#nested_resourceObject

Returns the value of attribute nested_resource.



4
5
6
# File 'lib/interview/controls/polymorphic_add_link.rb', line 4

def nested_resource
  @nested_resource
end

#objectObject

Returns the value of attribute object.



4
5
6
# File 'lib/interview/controls/polymorphic_add_link.rb', line 4

def object
  @object
end

#styleObject

Returns the value of attribute style.



4
5
6
# File 'lib/interview/controls/polymorphic_add_link.rb', line 4

def style
  @style
end

Instance Method Details

#renderObject



6
7
8
9
10
11
12
# File 'lib/interview/controls/polymorphic_add_link.rb', line 6

def render
  if @style and respond_to?("render_#{@style}_style", true)
    return send("render_#{@style}_style")
  else
    return render_dropdown_style
  end
end