Sha256: 65aa18b6a9a6ca32b4408a751ec1d3bb412b21d7ab708b47e60ba9437470bf14

Contents?: true

Size: 974 Bytes

Versions: 43

Compression:

Stored size: 974 Bytes

Contents

module Vedeu

  module Presentation

    # Provides style related presentation behaviour.
    #
    module Styles

      # When the style for the model exists, return it, otherwise
      # returns the parent style, or an empty
      # {Vedeu::Presentation::Style}.
      #
      # @return [Vedeu::Presentation::Style]
      def style
        @style ||= if attributes[:style]
                     Vedeu::Presentation::Style.coerce(attributes[:style])

                   elsif parent
                     Vedeu::Presentation::Style.coerce(parent.style)

                   else
                     Vedeu::Presentation::Style.new

                   end
      end

      # Allows the setting of the style by coercing the given value
      # into a {Vedeu::Presentation::Style}.
      #
      # @return [Vedeu::Presentation::Style]
      def style=(value)
        @style = Vedeu::Presentation::Style.coerce(value)
      end

    end # Style

  end # Presentation

end # Vedeu

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
vedeu-0.6.11 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.10 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.9 lib/vedeu/output/presentation/styles.rb