Module: Styles::Properties

Defined in:
lib/styles/properties.rb,
lib/styles/properties/base.rb,
lib/styles/properties/color.rb,
lib/styles/properties/width.rb,
lib/styles/properties/border.rb,
lib/styles/properties/margin.rb,
lib/styles/properties/display.rb,
lib/styles/properties/padding.rb,
lib/styles/properties/function.rb,
lib/styles/properties/text_align.rb,
lib/styles/properties/font_weight.rb,
lib/styles/properties/match_color.rb,
lib/styles/properties/text_decoration.rb,
lib/styles/properties/background_color.rb,
lib/styles/properties/match_font_weight.rb,
lib/styles/properties/match_text_decoration.rb,
lib/styles/properties/match_background_color.rb

Defined Under Namespace

Classes: BackgroundColor, Base, Border, Color, Display, FontWeight, Function, Margin, MatchBackgroundColor, MatchColor, MatchFontWeight, MatchTextDecoration, Padding, TextAlign, TextDecoration, Width

Class Method Summary collapse

Class Method Details

.all_property_classesObject



23
24
25
26
# File 'lib/styles/properties.rb', line 23

def self.all_property_classes
  constants = ::Styles::Properties.constants - [:Base]
  constants.map { |con| ::Styles::Properties.const_get(con) }
end

.find_class_by_property_name(name) ⇒ Object



28
29
30
31
# File 'lib/styles/properties.rb', line 28

def self.find_class_by_property_name(name)
  name = name.to_sym
  all_property_classes.find { |klass| klass.names.include? name }
end