Sha256: a967ebfbc187894ccad9b4a7a54c969711f4ad5d8fd57d1588340d30f2498460

Contents?: true

Size: 696 Bytes

Versions: 5

Compression:

Stored size: 696 Bytes

Contents

require File.join(File.dirname(__FILE__),"./parser")

module IceCream
  class IceCream

    def initialize(path)
      Dir.glob("#{path}/*.flavor") do |flavor_file_path|
        flavor = Parser.get_flavor flavor_file_path
        instance_name = flavor.class.to_s.downcase
        instance_variable_set("@"+instance_name, flavor)
        define_singleton_method(instance_name) do
          "@"+instance_name
        end
        define_singleton_method(instance_name+"=") do |new_value|
          require "pry"; binding.pry
          "@"+instance_name = new_value
        end
      end

      def flavor flavor
        instance_variable_get ("@" + flavor.to_s).to_sym
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
icecream-0.0.9 lib/icecream/icecream.rb
icecream-0.0.8 lib/icecream/icecream.rb
icecream-0.0.7 lib/icecream/icecream.rb
icecream-0.0.6 lib/icecream/icecream.rb
icecream-0.0.5 lib/icecream/icecream.rb