lib/legato/management/profile.rb in legato-0.5.1 vs lib/legato/management/profile.rb in legato-0.5.2

- old
+ new

@@ -20,10 +20,11 @@ :web_property_id => 'webPropertyId' } attr_accessor *GA_ATTRIBUTES.keys attr_accessor :user, :attributes + attr_writer :account, :web_property def initialize(attributes, user) self.user = user GA_ATTRIBUTES.each do |key,string_key| @@ -49,9 +50,16 @@ @web_property ||= WebProperty.from_child(self) end def goals Goal.for_profile(self) + end + + def self.build_from_summary(attributes, user, account, web_property) + Profile.new(attributes, user).tap { |profile| + profile.account = account + profile.web_property = web_property + } end end end end