Sha256: a65a3a61a8b821c3175629e73004b1f629b18c9ef3885a6296b0302b780c6980

Contents?: true

Size: 917 Bytes

Versions: 4

Compression:

Stored size: 917 Bytes

Contents

module Legato
  module Management
    class Profile

      extend Finder
      include ProfileMethods

      def self.default_path
        "/accounts/~all/webproperties/~all/profiles"
      end

      def path
        self.class.default_path + "/" + id.to_s
      end

      attr_accessor :id, :name, :web_property_id, :user, :attributes

      def initialize(attributes, user)
        self.user = user
        self.id = attributes['id']
        self.name = attributes['name']
        self.web_property_id = attributes['webPropertyId']

        ['id', 'name', 'webPropertyId'].each { |key| attributes.delete(key) }
        self.attributes = attributes
      end

      def self.for_account(account)
        all(account.user, account.path+'/webproperties/~all/profiles')
      end

      def self.for_web_property(web_property)
        all(web_property.user, web_property.path+'/profiles')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
legato-0.2.0 lib/legato/management/profile.rb
legato-0.1.0 lib/legato/management/profile.rb
legato-0.0.10 lib/legato/management/profile.rb
legato-0.0.9 lib/legato/management/profile.rb