Skip to content
A minimal DSL for doing notifications in RubyMotion (using NSNotificationCenter)
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
example
lib
spec
.gitignore
README.md
Rakefile
motify.gemspec

README.md

Motify

A minimal DSL for doing notifications in RubyMotion (using NSNotificationCenter) Just mix in the module to send or receive notifications

#handle notifications
class Soldier 
  include Motify

  def initialize
    on :new_mission_started do |location| 
      puts "ready to go to #{location}!"
    end
  end

  def become_disillusioned
    forget :new_mission_started
  end
end

#fire notifications
class Commander 
  include Motify

  def order_mission 
    fire :new_mission_started, 'russia'
  end
end

Installation

Add it to your Gemfile:

gem 'motify'

Or install it manually:

gem install motify

Something went wrong with that request. Please try again.