Class: Mixpal::User
- Inherits:
-
Object
- Object
- Mixpal::User
- Defined in:
- lib/mixpal/user.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties) ⇒ User
constructor
A new instance of User.
- #render ⇒ Object
- #to_store ⇒ Object
Constructor Details
#initialize(properties) ⇒ User
Returns a new instance of User.
5 6 7 |
# File 'lib/mixpal/user.rb', line 5 def initialize(properties) @properties = properties end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
3 4 5 |
# File 'lib/mixpal/user.rb', line 3 def properties @properties end |
Class Method Details
.from_store(data) ⇒ Object
19 20 21 |
# File 'lib/mixpal/user.rb', line 19 def self.from_store(data) new(data['properties']) end |
Instance Method Details
#render ⇒ Object
9 10 11 |
# File 'lib/mixpal/user.rb', line 9 def render "mixpanel.people.set(#{properties_as_js_object_for_mixpanel});".html_safe end |
#to_store ⇒ Object
13 14 15 16 17 |
# File 'lib/mixpal/user.rb', line 13 def to_store { 'properties' => properties } end |