Class: Raw::AttributeControl
- Defined in:
- lib/raw/control/attribute.rb
Overview
The base class for controls used to inspect object attributes. – TODO: find a better name. ++
Direct Known Subclasses
CheckboxControl, DatetimeControl, FileControl, FixnumControl, FloatControl, NoneControl, OptionsControl, PasswordControl, RelationControl, TextControl, TextareaControl
Instance Attribute Summary collapse
-
#anno ⇒ Object
The annotations used for rendering.
-
#attribute ⇒ Object
The attribute that this control renders.
-
#value ⇒ Object
(also: #values)
The value.
Attributes included from ElementMixin
#_children, #_parent, #_text, #_view, #id
Instance Method Summary collapse
-
#initialize(object, a, options) ⇒ AttributeControl
constructor
Input.
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 included from ElementMixin
#add_child, #close, #content, #include, #open, #render, #render_children
Constructor Details
#initialize(object, a, options) ⇒ AttributeControl
Input
-
object = the object to inspect
-
a = the attribute to inspect
-
options = additional options
32 33 34 35 36 37 38 |
# File 'lib/raw/control/attribute.rb', line 32 def initialize(object, a, ) @object = object @attribute = a @anno = @object.class.ann(@attribute) @value = @object.send(@attribute) @options = end |
Instance Attribute Details
#anno ⇒ Object
The annotations used for rendering
19 20 21 |
# File 'lib/raw/control/attribute.rb', line 19 def anno @anno end |
#attribute ⇒ Object
The attribute that this control renders.
15 16 17 |
# File 'lib/raw/control/attribute.rb', line 15 def attribute @attribute end |
#value ⇒ Object Also known as: values
The value
23 24 25 |
# File 'lib/raw/control/attribute.rb', line 23 def value @value end |