Class: Docks::Languages::Stylus

Inherits:
Base
  • Object
show all
Defined in:
lib/docks/languages/stylus_language.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#load_stub, #renderer, symbol_sources

Class Method Details

.extensionsObject



8
# File 'lib/docks/languages/stylus_language.rb', line 8

def self.extensions; %w(styl) end

.typeObject



7
# File 'lib/docks/languages/stylus_language.rb', line 7

def self.type; Docks::Types::Languages::STYLE end

Instance Method Details

#parserObject



23
# File 'lib/docks/languages/stylus_language.rb', line 23

def parser; Docks::Parsers::Stylus.instance end

#signature_for(symbol) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/docks/languages/stylus_language.rb', line 10

def signature_for(symbol)
  return unless [Types::Symbol::FUNCTION, Types::Symbol::MIXIN].include?(symbol.symbol_type)

  params = symbol.fetch(:params, []).map do |param|
    default = param.default
    param_string = param.name
    param_string << " = #{default}" if default
    param_string
  end

  "#{symbol.name}(#{params.join(", ")}) // ..."
end