class Sample
Copyright © 2011, SoundCloud Ltd., Nikola Chochkov
This is a sample of how to define new features to be tracked by GreenMidget
. Eg: define user features and check them on the message sender.
Attributes
user[RW]
Public Class Methods
new(text, user)
click to toggle source
# File lib/green_midget/extensions/sample.rb, line 11 def initialize(text, user) @text = text @user = user end
Private Instance Methods
features()
click to toggle source
Calls superclass method
GreenMidget::DefaultFeatures#features
# File lib/green_midget/extensions/sample.rb, line 18 def features %w(regular_user) + super end
regular_user?()
click to toggle source
# File lib/green_midget/extensions/sample.rb, line 22 def regular_user? # implement a method checking user type end