Module: AngryMob::Target::Tracking::ClassMethods
- Defined in:
- lib/angry_mob/target/tracking.rb
Instance Method Summary collapse
-
#inherited(klass) ⇒ Object
Everytime someone inherits from a AngryMob::Target class, register the klass and file into baseclass.
-
#method_added(meth) ⇒ Object
Fire this callback whenever a method is added.
- #nickname(name = nil) ⇒ Object
Instance Method Details
#inherited(klass) ⇒ Object
Everytime someone inherits from a AngryMob::Target class, register the klass and file into baseclass.
36 37 38 |
# File 'lib/angry_mob/target/tracking.rb', line 36 def inherited(klass) AngryMob::Target::Tracking.register_klass_file(klass) end |
#method_added(meth) ⇒ Object
Fire this callback whenever a method is added. Added methods are tracked as tasks by invoking the create_task method.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/angry_mob/target/tracking.rb', line 42 def method_added(meth) meth = meth.to_s if meth == "initialize" initialize_added return end # Return if it's not a public instance method return unless public_instance_methods.include?(meth) || public_instance_methods.include?(meth.to_sym) return unless create_action(meth) #is_thor_reserved_word?(meth, :task) AngryMob::Target::Tracking.register_klass_file(self) end |
#nickname(name = nil) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/angry_mob/target/tracking.rb', line 60 def nickname(name=nil) if name @nickname = name AngryMob::Target::Tracking.register_klass_file(self) else if @nickname @nickname else Util.snake_case(to_s) end end end |