Sha256: e40f734676086d2027ea224571c52de2d9439329ed97ebfec89fa3172b99c926

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

require 'singleton'
require 'yaml'
require 'ostruct'

require 'thor'
require 'httparty'

require 'hanoi/jane/version'

require 'hanoi/jane/config'
require 'hanoi/jane/exceptions'

require 'hanoi/jane/towers/stack_finders'
require 'hanoi/jane/towers/regular_towers'
require 'hanoi/jane/towers/constrained_towers'
require 'hanoi/jane/towers/animated_towers'

require 'hanoi/jane/animation/animation'
require 'hanoi/jane/animation/lifter'
require 'hanoi/jane/animation/dropper'
require 'hanoi/jane/animation/padded_stacks'

require 'hanoi/jane/formatters/matrix'
require 'hanoi/jane/formatters/console'

module Hanoi
  module Jane
    def self.hit_phat stacks, value, phat
      matrix = Formatters::Matrix.new do |m|
        m.stacks = stacks
        m.digits = value
      end
      matrix.populate

      url = "http://#{phat}/lights"
      payload = {
        matrix: matrix
      }
      headers = {
        'Content-Type' => 'application/json',
        'Accept' => 'application/json'
      }

      HTTParty.patch(url, body: payload.to_json, headers: headers)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hanoi-jane-0.3.1 lib/hanoi/jane.rb