This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooBar | |
attr_reader :a, :b | |
def initialize | |
@a = 1 | |
@b = 2 | |
@c = 3 | |
end | |
def see_the_c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
MY_CONST = "hello".freeze | |
end | |
puts Foo::MY_CONST # "hello" | |
Foo.const_set("MY_CONST", "new const") | |
puts Foo::MY_CONST # "new const" | |
class Foo | |
def self.my_const |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "thwait" | |
class Job; end | |
module Processor | |
def self.perform(worker_count, jobs) | |
workers = worker_count.times.map do | |
Thread.new do | |
while job = jobs.pop | |
yield job |
OlderNewer