Class: MistApi::SiteEngagementDwellTags

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/site_engagement_dwell_tags.rb

Overview

add tags to visits within the duration (in seconds)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(bounce = '301-14400', engaged = '14401-28800', passerby = '1-300', stationed = '28801-42000') ⇒ SiteEngagementDwellTags

Returns a new instance of SiteEngagementDwellTags.



58
59
60
61
62
63
64
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 58

def initialize(bounce = '301-14400', engaged = '14401-28800',
               passerby = '1-300', stationed = '28801-42000')
  @bounce = bounce unless bounce == SKIP
  @engaged = engaged unless engaged == SKIP
  @passerby = passerby unless passerby == SKIP
  @stationed = stationed unless stationed == SKIP
end

Instance Attribute Details

#bounceString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 14

def bounce
  @bounce
end

#engagedString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 18

def engaged
  @engaged
end

#passerbyString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 22

def passerby
  @passerby
end

#stationedString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 26

def stationed
  @stationed
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bounce = hash['bounce'] ||= '301-14400'
  engaged = hash['engaged'] ||= '14401-28800'
  passerby = hash['passerby'] ||= '1-300'
  stationed = hash['stationed'] ||= '28801-42000'

  # Create object from extracted values.
  SiteEngagementDwellTags.new(bounce,
                              engaged,
                              passerby,
                              stationed)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bounce'] = 'bounce'
  @_hash['engaged'] = 'engaged'
  @_hash['passerby'] = 'passerby'
  @_hash['stationed'] = 'stationed'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 49

def self.nullables
  %w[
    bounce
    engaged
    passerby
    stationed
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 39

def self.optionals
  %w[
    bounce
    engaged
    passerby
    stationed
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



91
92
93
94
95
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 91

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bounce: #{@bounce.inspect}, engaged: #{@engaged.inspect}, passerby:"\
  " #{@passerby.inspect}, stationed: #{@stationed.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



84
85
86
87
88
# File 'lib/mist_api/models/site_engagement_dwell_tags.rb', line 84

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bounce: #{@bounce}, engaged: #{@engaged}, passerby: #{@passerby},"\
  " stationed: #{@stationed}>"
end