Sha256: 90f13b3657c7bf4683753c2192a94a41b65f342769cdeaec6a674bb1bf5d0648
Contents?: true
Size: 723 Bytes
Versions: 16
Compression:
Stored size: 723 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(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
16 entries across 16 versions & 1 rubygems