Skip to content
KVO in Ruby
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
README.md
Rakefile
kvo.gemspec

README.md

Description

Key-Value Observing in ruby

Synopsis

Fires a Publisher event whenever the variable is set.

How do I use it?

class Foo
  include Kvo
  kvo_attr_accessor :bar, :baz
end

f = Foo.new
f.when :bar_changed do |oldVal, newVal|
  puts "bar was changed from #{oldVal} to #{newVal}"
end

Authors

Something went wrong with that request. Please try again.