Class: Mayu::Resources::Types::Stylesheet::ClassNames

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mayu/resources/types/stylesheet.rb

Instance Method Summary collapse

Constructor Details

#initialize(classes) ⇒ ClassNames

Returns a new instance of ClassNames.



16
17
18
# File 'lib/mayu/resources/types/stylesheet.rb', line 16

def initialize(classes)
  @classes = classes
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(ident) ⇒ Object



21
22
23
# File 'lib/mayu/resources/types/stylesheet.rb', line 21

def method_missing(ident)
  @classes[ident].to_s
end

Instance Method Details

#[](*args) ⇒ Object



26
27
28
29
30
# File 'lib/mayu/resources/types/stylesheet.rb', line 26

def [](*args)
  args
    .each_with_object(Set.new) { |arg, set| add_to_result(set, arg) }
    .join(" ")
end