Sha256: 23e3318fcd4b1c20ab48408b3fc3d273c3e6351ed4e69552e769110149110cc8

Contents?: true

Size: 738 Bytes

Versions: 6

Compression:

Stored size: 738 Bytes

Contents

require "sfn"

module Sfn
  module Utils

    # Storage helpers
    module ObjectStorage

      # Write to file
      #
      # @param object [Object]
      # @param path [String] path to write object
      # @param directory [Miasma::Models::Storage::Directory]
      # @return [String] file path
      def file_store(object, path, directory)
        raise NotImplementedError.new "Internal updated required! :("
        content = object.is_a?(String) ? object : Utils._format_json(object)
        directory.files.create(
          :identity => path,
          :body => content,
        )
        loc = directory.service.service.name.split("::").last.downcase
        "#{loc}://#{directory.identity}/#{path}"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sfn-3.1.8 lib/sfn/utils/object_storage.rb
sfn-3.1.6 lib/sfn/utils/object_storage.rb
sfn-3.1.4 lib/sfn/utils/object_storage.rb
sfn-3.1.2 lib/sfn/utils/object_storage.rb
sfn-3.1.0 lib/sfn/utils/object_storage.rb
sfn-3.0.32 lib/sfn/utils/object_storage.rb