Class: Mixpal::User

Inherits:
Object
  • Object
show all
Defined in:
lib/mixpal/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#propertiesObject (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

#renderObject



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_storeObject



13
14
15
16
17
# File 'lib/mixpal/user.rb', line 13

def to_store
  {
    'properties' => properties
  }
end