Class: CSS::ListStyleProperty

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

Instance Method Summary collapse

Methods inherited from Property

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

Methods included from Normalize

#normalize_property_name

Constructor Details

#initialize(*args) ⇒ ListStyleProperty

Returns a new instance of ListStyleProperty.



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

def initialize(*args)
  @properties = default_properties.clone
  super
end

Dynamic Method Handling

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

Instance Method Details

#nameObject



8
9
10
# File 'lib/css/properties/list_style_property.rb', line 8

def name
  'list-style'
end

#to_sObject



12
13
14
# File 'lib/css/properties/list_style_property.rb', line 12

def to_s
  %w(type position image).map { |prop| @properties[prop] }.join(' ')
end

#to_styleObject



16
17
18
# File 'lib/css/properties/list_style_property.rb', line 16

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

#typeObject



20
21
22
# File 'lib/css/properties/list_style_property.rb', line 20

def type
  default_properties['type'] == @properties['type'] ? nil : @properties['type']
end

#type=(val) ⇒ Object



24
25
26
# File 'lib/css/properties/list_style_property.rb', line 24

def type=(val)
  @properties['type'] = val
end