Sha256: ad69856fac5aa7f32656bbd864d2f3f3e7d9d54f757745e616d9d3fec1247305

Contents?: true

Size: 1012 Bytes

Versions: 5

Compression:

Stored size: 1012 Bytes

Contents

module Scrivito
  class WorkspaceData
    class << self
      private

      def data_attr_reader(attr_name)
        define_method(attr_name) { @data[attr_name.to_s] }
      end
    end

    data_attr_reader :id
    data_attr_reader :title
    data_attr_reader :memberships
    data_attr_reader :revision_id
    data_attr_reader :content_state_id
    data_attr_reader :uses_obj_classes
    data_attr_reader :base_revision_id
    data_attr_reader :base_content_state_id

    def initialize(data)
      @data = data
    end

    def store_in_cache
      CmsDataCache.write_workspace_data(id, to_hash)
    end

    private

    def to_hash
      {
        'id'                    => id,
        'revision_id'           => revision_id,
        'title'                 => title,
        'content_state_id'      => content_state_id,
        'base_revision_id'      => base_revision_id,
        'base_content_state_id' => base_content_state_id,
        'memberships'           => memberships,
      }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scrivito_sdk-0.65.2 lib/scrivito/workspace_data.rb
scrivito_sdk-0.65.1 lib/scrivito/workspace_data.rb
scrivito_sdk-0.65.0 lib/scrivito/workspace_data.rb
scrivito_sdk-0.65.0.rc2 lib/scrivito/workspace_data.rb
scrivito_sdk-0.65.0.rc1 lib/scrivito/workspace_data.rb