Sha256: 5ec45816db0c317fa685f8c85ea069056b2148f5b94159eb6289984a2c7d7f82

Contents?: true

Size: 650 Bytes

Versions: 13

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

require_relative '../helpers/hash'

module NanoBot
  module Logic
    module Cartridge
      module Streaming
        def self.enabled?(cartridge, interface)
          return false if Helpers::Hash.fetch(cartridge, %i[provider settings stream]) == false

          specific_interface = Helpers::Hash.fetch(cartridge, [:interfaces, interface, :output, :stream])

          return specific_interface unless specific_interface.nil?

          interface = Helpers::Hash.fetch(cartridge, %i[interfaces output stream])

          return interface unless interface.nil?

          true
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
nano-bots-1.1.2 logic/cartridge/streaming.rb
nano-bots-1.1.1 logic/cartridge/streaming.rb
nano-bots-1.1.0 logic/cartridge/streaming.rb
nano-bots-1.0.1 logic/cartridge/streaming.rb
nano-bots-1.0.0 logic/cartridge/streaming.rb
nano-bots-0.1.1 logic/cartridge/streaming.rb
nano-bots-0.1.0 logic/cartridge/streaming.rb
nano-bots-0.0.10 logic/cartridge/streaming.rb
nano-bots-0.0.9 logic/cartridge/streaming.rb
nano-bots-0.0.8 logic/cartridge/streaming.rb
nano-bots-0.0.7 logic/cartridge/streaming.rb
nano-bots-0.0.6 logic/cartridge/streaming.rb
nano-bots-0.0.5 logic/cartridge/streaming.rb