Sha256: 2dbf790718a2708c7eb7a7d16b36ddd3e20517b6e018e888483369bd3f7f73cd
Contents?: true
Size: 1.38 KB
Versions: 2
Compression:
Stored size: 1.38 KB
Contents
# frozen_string_literal: true module Vedeu module Presentation module Colour # Provides the background colour when included in a class with # a colour attribute. # # @api private # module Background include Vedeu::Repositories::Parent # When the background colour for the model exists, return it, # otherwise returns the parent background colour, or an empty # Vedeu::Colours::Background. # # @return [Vedeu::Colours::Background] def background @background ||= if colour && present?(colour.background) colour.background elsif named_colour? named_colour.background elsif parent && present?(parent.background) parent.background else Vedeu::Colours::Background.new end end # Allows the setting of the background colour by coercing the # given value into a Vedeu::Colours::Background colour. # # @return [Vedeu::Colours::Background] def background=(value) @background = colour.background = value @_colour = @colour = colour end end # Background end # Colour end # Presentation end # Vedeu
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.8.4 | lib/vedeu/presentation/background.rb |
vedeu-0.8.3 | lib/vedeu/presentation/background.rb |