Sha256: 96f3d643ab4984542b79ee4b85cc6913ef1deded70d2fbe43a384e1c9fa5ebff

Contents?: true

Size: 739 Bytes

Versions: 10

Compression:

Stored size: 739 Bytes

Contents

# encoding: UTF-8

module Spontaneous::Prototypes
  class StylePrototype
    attr_reader :owner, :name, :options

    def initialize(owner, name, options = {})
      @owner, @name, @options = owner, name, options
    end

    def default?
      options[:default]
    end

    def schema_name
      "style/#{owner.schema_id}/#{name}"
    end

    def schema_owner
      owner
    end

    def owner_sid
      schema_owner.schema_id
    end

    def style(owner)
      Spontaneous::Style.new(owner, self)
    end

    def schema_id
      Spontaneous.schema.to_id(self)
    end

    def export(user)
      {
        :name => name.to_s,
        :schema_id => schema_id.to_s
      }
    end
  end # StylePrototype
end # Spontaneous::Prototypes

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta9 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta8 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta7 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta6 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta5 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta4 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta3 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta2 lib/spontaneous/prototypes/style_prototype.rb
spontaneous-0.2.0.beta1 lib/spontaneous/prototypes/style_prototype.rb