Sha256: c8e1e73ced1653a3a061bfde44908aa403656843662dbd3d41cd6df6e02af44c
Contents?: true
Size: 863 Bytes
Versions: 54
Compression:
Stored size: 863 Bytes
Contents
module Ecoportal module API class V2 class Registers class Register < Common::Content::DoubleModel passkey :id passthrough :name class_resolver :template_class, "Ecoportal::API::V2::Registers::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 end
Version data entries
54 entries across 54 versions & 2 rubygems