Sha256: 8f55017bb14fe1196d97b827cd0c748f4331326e533b4dc8155c1123984cc4fe
Contents?: true
Size: 626 Bytes
Versions: 17
Compression:
Stored size: 626 Bytes
Contents
module Refinery module Pages class Types < Array def register(name, &block) self.class.register(name, &block) end def find_by_name(name) detect {|type| type.name.to_s.downcase == name.to_s.downcase} end class << self def register(name, &block) type = Type.new type.name = name yield type if block_given? raise "A page type must have a name: #{self.inspect}" if type.name.blank? registered << type end def registered @registered_types ||= new end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems