Sha256: 5713f639b231c9e036bb9dd0ad748529d5d4300e9fa651e5a17ead5ee7f7fc1f

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

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 self.is_a?(Vedeu::Views::Char) && name
                     Vedeu::Presentation::Style.coerce(interface.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

17 entries across 17 versions & 1 rubygems

Version Path
vedeu-0.6.69 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.68 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.67 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.66 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.65 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.64 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.63 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.62 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.61 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.60 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.59 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.58 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.57 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.56 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.54 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.53 lib/vedeu/output/presentation/styles.rb
vedeu-0.6.52 lib/vedeu/output/presentation/styles.rb