Module: Ruflet::Icons

Defined in:
lib/ruflet_ui.rb

Defined Under Namespace

Classes: IconGroup

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



105
106
107
108
109
110
111
# File 'lib/ruflet_ui.rb', line 105

def [](name)
  key = name.to_s.upcase.to_sym
  return Ruflet::MaterialIcons.const_get(key) if Ruflet::MaterialIcons.const_defined?(key, false)
  return Ruflet::CupertinoIcons.const_get(key) if Ruflet::CupertinoIcons.const_defined?(key, false)

  Ruflet::IconData.new(name.to_s)
end

.const_missing(name) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
# File 'lib/ruflet_ui.rb', line 93

def const_missing(name)
  if Ruflet::MaterialIcons.const_defined?(name, false)
    return Ruflet::MaterialIcons.const_get(name)
  end

  if Ruflet::CupertinoIcons.const_defined?(name, false)
    return Ruflet::CupertinoIcons.const_get(name)
  end

  super
end

.cupertinoObject



89
90
91
# File 'lib/ruflet_ui.rb', line 89

def cupertino
  @cupertino ||= IconGroup.new(Ruflet::CupertinoIcons)
end

.materialObject



85
86
87
# File 'lib/ruflet_ui.rb', line 85

def material
  @material ||= IconGroup.new(Ruflet::MaterialIcons)
end