Module: Ruflet::Icons

Defined in:
lib/ruflet_ui.rb

Defined Under Namespace

Classes: IconGroup

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



120
121
122
123
124
125
126
# File 'lib/ruflet_ui.rb', line 120

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



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/ruflet_ui.rb', line 108

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



104
105
106
# File 'lib/ruflet_ui.rb', line 104

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

.materialObject



100
101
102
# File 'lib/ruflet_ui.rb', line 100

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