Skip to content

A minimal DSL for doing notifications in RubyMotion (using NSNotificationCenter)

Notifications You must be signed in to change notification settings

michael-erasmus/motify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A minimal DSL for doing notifications in RubyMotion (using NSNotificationCenter)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages