Sha256: 3c96c56fc8a29718443f9dcf07740d40079246a49a28f558a1ab6b19a606504f
Contents?: true
Size: 727 Bytes
Versions: 17
Compression:
Stored size: 727 Bytes
Contents
module Arrest module HasView include Arrest::HasAttributes def self.included(base) base.extend(ClassMethods) end module ClassMethods def has_view(*args) method_name, options = args if options clazz = options[:class_name] end clazz ||= StringUtils.classify(method_name.to_s) send :define_method, method_name do @views ||= {} @views[method_name] ||= begin r = self.class.source().get_one(self.context, "#{self.resource_path}/#{id}/#{method_name}") r = self.class.body_root(r) Arrest::Source.mod.const_get(clazz).new(self.context, r) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems