Sha256: b0727e4d1df6bb37b58a9548877a727797c9a8b14480ff408a228b791397398d

Contents?: true

Size: 404 Bytes

Versions: 2

Compression:

Stored size: 404 Bytes

Contents

module Space
  module Commands
    attr_reader :path

    def initialize(path)
      @path = path
    end

    def result(command)
      commands[command].result
    end

    def commands
      @commands ||= Hash[*self.class::COMMANDS.map do |key, cmd|
        [key, Command.new(path, cmd)]
      end.flatten]
    end

    def reset
      commands.each { |key, command| command.reset }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
space-0.0.3 lib/space/models/commands.rb
space-0.0.2 lib/space/models/commands.rb