Sha256: 3ce79686f235a5ce47cf44baa337338d72bcc3e90d535419757c8469276635b1
Contents?: true
Size: 376 Bytes
Versions: 3
Compression:
Stored size: 376 Bytes
Contents
module Basic101 class BinaryOperations include Identity def initialize(left, operations) @left = left @operations = operations end def eval(runtime) @operations.inject(@left) do |result, operation| operation.operate(result, runtime) end end protected def state [@left, @operations] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
basic101-0.4.0 | lib/basic101/binary_operations.rb |
basic101-0.2.0 | lib/basic101/binary_operations.rb |
basic101-0.1.0 | lib/basic101/binary_operations.rb |