class Sf::StackOperation
Public Class Methods
new(operations: [])
click to toggle source
# File lib/sf.rb, line 9 def initialize(operations: []) # puts "Initial Stack: #{operations}" @operations = operations @equality_called = false end
Public Instance Methods
call(target)
click to toggle source
Super naive for now, proof of concept. Will get order of ops later.
# File lib/sf.rb, line 20 def call(target) # puts "Streamed Target: #{target}" # puts "Evaluation Target: '#{target.inspect} #{@operations.join(' ')}'" eval("#{target.inspect} #{@operations.join(' ')}") end
to_proc()
click to toggle source
# File lib/sf.rb, line 15 def to_proc proc { |target| self.call(target) } end