Sha256: 38e193718d060f3bbedff390a023232532ee19aa67e0b62ab4a0f61ae4b29da7

Contents?: true

Size: 555 Bytes

Versions: 10

Compression:

Stored size: 555 Bytes

Contents

module LadyJosephine
  class Whitelist
    include Singleton

    def initialize
      @whitelist_classes = []
    end

    def whitelist(class_to_add)
      if class_to_add.instance_of? String
        @whitelist_classes << class_to_add
      else
        @whitelist_classes << class_to_add.to_s
      end
    end

    def is_whitelisted?(class_to_check)
      if class_to_check.instance_of? String
        @whitelist_classes.include? class_to_check.classify
      else
        @whitelist_classes.include? class_to_check.to_s
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lady_josephine-0.7.0 lib/lady_josephine/whitelist.rb
lady_josephine-0.6.3 lib/lady_josephine/whitelist.rb
lady_josephine-0.6.2 lib/lady_josephine/whitelist.rb
lady_josephine-0.6.1 lib/lady_josephine/whitelist.rb
lady_josephine-0.6.0 lib/lady_josephine/whitelist.rb
lady_josephine-0.5.0 lib/lady_josephine/whitelist.rb
lady_josephine-0.0.4 lib/lady_josephine/whitelist.rb
lady_josephine-0.0.3 lib/lady_josephine/whitelist.rb
lady_josephine-0.0.2 lib/lady_josephine/whitelist.rb
lady_josephine-0.0.1 lib/lady_josephine/whitelist.rb