Sha256: ff2223fc40e4dda1e7801f97ef6156377ad2ceaa735117f99fdb05450b585d0c
Contents?: true
Size: 811 Bytes
Versions: 12
Compression:
Stored size: 811 Bytes
Contents
module Ecoportal module API class V2 class Register < Common::Content::DoubleModel passkey :id passthrough :name class_resolver :template_class, "Ecoportal::API::V2::Template" def templates_by_id @templates_by_id or index_templates @templates_by_id end def [](id) templates_by_id[id] end def templates templates_by_id.values end def index_templates @templates_by_id = {} doc["templates"].each do |template_doc| template = template_class.new(template_doc) @templates_by_id[template.id] = template end end end end end end require 'ecoportal/api/v2/template'
Version data entries
12 entries across 12 versions & 1 rubygems