Sha256: bb78dd2ce1306f893952683c98c9cc20b2653d0d88ddaa7e47e2a2bf85ef675a
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 foreground colour when included in a class with # a colour attribute. # # @api private # module Foreground include Vedeu::Repositories::Parent # When the foreground colour for the model exists, return it, # otherwise returns the parent foreground colour, or an empty # Vedeu::Colours::Foreground. # # @return [Vedeu::Colours::Foreground] def foreground @foreground ||= if colour && present?(colour.foreground) colour.foreground elsif named_colour? named_colour.foreground elsif parent && present?(parent.foreground) parent.foreground else Vedeu::Colours::Foreground.new end end # Allows the setting of the foreground colour by coercing the # given value into a Vedeu::Colours::Foreground colour. # # @return [Vedeu::Colours::Foreground] def foreground=(value) @foreground = colour.foreground = value @_colour = @colour = colour end end # Foreground 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/foreground.rb |
vedeu-0.8.3 | lib/vedeu/presentation/foreground.rb |