Class: Ptero::Generator::JavascriptGenerator

Inherits:
Ptero::Generator show all
Defined in:
lib/ptero/generators/javascriptgenerator.rb

Overview

Generate Javascripts

Direct Known Subclasses

ApplicationJavascriptGenerator

Instance Attribute Summary collapse

Attributes inherited from Ptero::Generator

#app, #dir, #name

Instance Method Summary collapse

Methods inherited from Ptero::Generator

const_missing, #content, #content_params, #filename, #generate, #generated?, #location, #reload, #remove, #template_path, #to_s, #type

Constructor Details

#initialize(name, desc = 'This script does...') ⇒ JavascriptGenerator

Initialize with name and an optional description that will be generated in a comment. (Defaults to “This script does…”)

Parameters:

  • name (String)

    the name of the Javascript

  • desc (String) (defaults to: 'This script does...')

    a String to describe this script



15
16
17
18
# File 'lib/ptero/generators/javascriptgenerator.rb', line 15

def initialize(name,desc = 'This script does...')
  super name
  @desc = desc
end

Instance Attribute Details

#descObject (readonly)

Returns the value of attribute desc.



20
21
22
# File 'lib/ptero/generators/javascriptgenerator.rb', line 20

def desc
  @desc
end

Instance Method Details

#extensionString

Returns “js”.

Returns:

  • (String)

    “js”



28
29
30
# File 'lib/ptero/generators/javascriptgenerator.rb', line 28

def extension
  'js'
end

#pathString

Returns “www/assets/js”.

Returns:

  • (String)

    “www/assets/js”



23
24
25
# File 'lib/ptero/generators/javascriptgenerator.rb', line 23

def path
  'www/assets/js'
end