Class: CSS::BackgroundProperty

Inherits:
Property
  • Object
show all
Defined in:
lib/css/properties/background_property.rb

Instance Method Summary collapse

Methods inherited from Property

#<<, #==, #[], create, #get, #initialize, #inspect, #method_missing, #value

Methods included from Normalize

#normalize_property_name

Constructor Details

This class inherits a constructor from CSS::Property

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CSS::Property

Instance Method Details

#nameObject



3
4
5
# File 'lib/css/properties/background_property.rb', line 3

def name
  'background'
end

#to_sObject



7
8
9
# File 'lib/css/properties/background_property.rb', line 7

def to_s
  %w(color image repeat position attachment).map { |prop| @properties[prop] && @properties[prop] != default_properties[prop] ? @properties[prop].value : nil }.compact.join(' ')
end

#to_styleObject



11
12
13
# File 'lib/css/properties/background_property.rb', line 11

def to_style
  [name, to_s].join(':')
end