Sha256: deaa66ac6bd10fb66612f5f9be477a3801cfa8b62be4f03623a210919437bfcb

Contents?: true

Size: 280 Bytes

Versions: 24

Compression:

Stored size: 280 Bytes

Contents

require 'active_support/inflector'

module Brightcontent
  Resource = Struct.new(:path) do
    def klass
      path.classify.constantize
    rescue
      "Brightcontent::#{path.classify}".constantize
    end

    def to_partial_path
      "application/resource"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
brightcontent-core-2.1.3 lib/brightcontent/resource.rb
brightcontent-core-2.1.2 lib/brightcontent/resource.rb
brightcontent-core-2.1.1 lib/brightcontent/resource.rb
brightcontent-core-2.1.0 lib/brightcontent/resource.rb