Sha256: 579ce6b406dff02f1c2b80c3dfc2f59128a384b8a07f5b751a776a5a28aceb6c
Contents?: true
Size: 866 Bytes
Versions: 2
Compression:
Stored size: 866 Bytes
Contents
module Ecoportal module API class V2 class Page class Components < Common::Content::CollectionModel class_resolver :component_class, "Ecoportal::API::V2::Page::Component" self.klass do |doc| component_class.get_class(doc).tap do |klass| klass.key = :id end end order_matters = true def get_by_type(type) self.select do |comp| comp.type.downcase == type.to_s.strip.downcase end end def get_by_name(name, type: nil) pool = type ? get_by_type(type) : self pool.select do |comp| comp.label.to_s.strip.downcase == name.to_s.strip.downcase end.first end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ecoportal-api-oozes-0.5.7 | lib/ecoportal/api/v2/page/components.rb |
ecoportal-api-oozes-0.5.6 | lib/ecoportal/api/v2/page/components.rb |