Project

motify

0.0
No commit activity in last 3 years
No release in over 3 years
A minimal DSL for doing notifications in RubyMotion (using NSNotificationCenter)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

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