Class: Nitro::RelationControl
- Inherits:
-
AttributeControl
- Object
- Element
- Control
- AttributeControl
- Nitro::RelationControl
- Defined in:
- lib/nitro/control/relation.rb
Overview
The base class for controls used to inspect object relations. – FIXME: this is a temp hack. TODO: Fix mismatches with attributes. ++
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from AttributeControl
Attributes included from ElementMixin
#_children, #_parent, #_text, #_view, #id
Instance Method Summary collapse
-
#initialize(object, rel, options) ⇒ RelationControl
constructor
Input.
- #rel ⇒ Object
- #symbol ⇒ Object
Methods included from XhtmlHelper
#date_select, #datetime_select, #hidden, #href_of, #js_popup, #link_to, #objects_to_options, #onclick_popup, #options, #popup, #submit, #time_select
Methods inherited from Element
Methods included from ElementMixin
#add_child, #close, #content, #open, #render, #render_children
Constructor Details
#initialize(object, rel, options) ⇒ RelationControl
Input
-
object = the object to inspect
-
symbol = the relation symbol
-
anno = the relation annotations
-
options = additional options
21 22 23 24 25 26 |
# File 'lib/nitro/control/relation.rb', line 21 def initialize object, rel, @object = object @anno = rel @value = [:value] || object.send(rel.name.to_sym) @options = end |
Instance Method Details
#rel ⇒ Object
32 33 34 |
# File 'lib/nitro/control/relation.rb', line 32 def rel @anno end |
#symbol ⇒ Object
28 29 30 |
# File 'lib/nitro/control/relation.rb', line 28 def symbol @anno[:symbol] end |