Module: Knuckles::View
Instance Method Summary collapse
- #data(_object, _options = {}) ⇒ Object
- #has_many(objects, view, options = {}) ⇒ Object
-
#has_one(object, view, options = {}) ⇒ Object
Relations.
- #relations(_object, _options = {}) ⇒ Object
-
#root ⇒ Object
Callbacks.
Instance Method Details
#data(_object, _options = {}) ⇒ Object
12 13 14 |
# File 'lib/knuckles/view.rb', line 12 def data(_object, = {}) {} end |
#has_many(objects, view, options = {}) ⇒ Object
26 27 28 |
# File 'lib/knuckles/view.rb', line 26 def has_many(objects, view, = {}) objects.map { |object| view.data(object, ) } end |
#has_one(object, view, options = {}) ⇒ Object
Relations
22 23 24 |
# File 'lib/knuckles/view.rb', line 22 def has_one(object, view, = {}) [view.data(object, )] end |
#relations(_object, _options = {}) ⇒ Object
16 17 18 |
# File 'lib/knuckles/view.rb', line 16 def relations(_object, = {}) {} end |
#root ⇒ Object
Callbacks
9 10 |
# File 'lib/knuckles/view.rb', line 9 def root end |