class Yarrow::Web::Document
Public Class Methods
new(item, is_index)
click to toggle source
This class is somewhat verbose for simplicity and long-term maintainability (having a clear and easy to follow construction, rather than doing anything too clever which has burned this lib in the past).
# File lib/yarrow/web/document.rb, line 113 def initialize(item, is_index) @item = item @type = item.props[:type] @parent = item.in(:collection).first @node = item @is_index = is_index @resource = item.props[:resource] instance_variable_set("@#{item.props[:type]}", @resource) define_singleton_method(item.props[:type]){ @resource } end