Sha256: c12ba9e3b33853792ecd8339b3bf2a8526a3627e0a23ebf8d921fe0bb849c7cb

Contents?: true

Size: 580 Bytes

Versions: 1

Compression:

Stored size: 580 Bytes

Contents

module PlatinaWorld
  module Fetchable
    def contents
      @contents ||= (contents_fetcher && contents_fetcher.fetch)
    end

    def has_contents?
      !!contents
    end

    private

    def contents_path
      fail NotImplementedError
    end

    def has_contents_path?
      !!contents_path
    end

    def contents_fetcher
      return @contents_fetcher if instance_variable_defined?(:@contents_fetcher)
      @contents_fetcher =
        if has_contents_path?
          FetcherBuilder.new(contents_path).build
        else
          nil
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
platina_world-0.1.5 lib/platina_world/fetchable.rb