Class: Rid::Commands::Fn::Generator

Inherits:
Object
  • Object
show all
Includes:
Filander
Defined in:
lib/rid-fn.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Generator

Returns a new instance of Generator.



13
14
15
16
# File 'lib/rid-fn.rb', line 13

def initialize(options)
  @type, @doc, @name = options.type, options.doc, options.name
  self.class.source_root File.expand_path('../templates', __FILE__)
end

Instance Attribute Details

#name ⇒ Object (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/rid-fn.rb', line 11

def name
  @name
end

Instance Method Details

#invoke ⇒ Object



18
19
20
21
22
23
24
# File 'lib/rid-fn.rb', line 18

def invoke
  inside '.', @doc do
    inside '.', @type.pluralize do
      template @type + '.js', @name + '.js'
    end
  end
end