Class: CSS::BorderProperty
- Defined in:
- lib/css/properties/border_property.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Property
#<<, #==, #[], create, #get, #initialize, #inspect, #method_missing, #value
Methods included from Normalize
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
#name ⇒ Object
3 4 5 |
# File 'lib/css/properties/border_property.rb', line 3 def name 'border' end |
#to_s ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/css/properties/border_property.rb', line 7 def to_s value = %w(size style color).map { |prop| @properties[prop] && @properties[prop] != default_properties[prop] ? @properties[prop].value : nil }.compact.join(' ') if value == @properties['size'].value "#{@properties['size']}" else value end end |
#to_style ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/css/properties/border_property.rb', line 16 def to_style value = %w(size style color).map { |prop| @properties[prop] && @properties[prop] != default_properties[prop] ? @properties[prop].value : nil }.compact.join(' ') if value == @properties['size'].value "border-size:#{@properties['size']}" else [name, value].join(':') end end |