Class: Abrupt::Transformation::Client::PageView

Inherits:
Base
  • Object
show all
Defined in:
lib/abrupt/transformation/client/page_view.rb

Overview

Transformation clas for client visit data

Constant Summary

Constants inherited from Base

Base::SCHEMA_MAPPING

Instance Attribute Summary

Attributes inherited from Base

#md5, #parent_uri, #result, #uri, #values

Instance Method Summary collapse

Methods inherited from Base

#add_data_property, #add_individual, #add_object_property, #class_name, customize_to_schema, #initialize, #keyname, #resolve_parent_uri, #resolve_parent_uri_part, #resolve_uri, #resolve_uri_part, set_value

Constructor Details

This class inherits a constructor from Abrupt::Transformation::Base

Instance Method Details

#add_individualsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/abrupt/transformation/client/page_view.rb', line 7

def add_individuals
  datetime = @values['datetime']
  return @result unless datetime
  @values[:name] = ::Abrupt.format_time(datetime)
  super
  @values.each do |_i, attr|
    next if attr.is_a?(String)
    name = attr.name.eql?('name') ? 'inputname' : attr.name
    value = if name.eql?('datetime')
              Abrupt.parse_time(attr.value)
            else
              CGI.escape(attr.value)
            end
    add_data_property(name, value)
  end
  @result
end