Class: Tzispa::Commands::Rig

Inherits:
Command
  • Object
show all
Defined in:
lib/tzispa/commands/rig.rb

Constant Summary

Constants inherited from Command

Command::NO_PROJECT_FOLDER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, app, type, mime_format = nil, options = nil) ⇒ Rig

Returns a new instance of Rig.



11
12
13
14
15
16
17
# File 'lib/tzispa/commands/rig.rb', line 11

def initialize(name, app, type, mime_format = nil, options = nil)
  super(options)
  @domain = Tzispa::Domain.new app
  @type = type.to_sym
  @name = name
  @mime_format = mime_format
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



9
10
11
# File 'lib/tzispa/commands/rig.rb', line 9

def domain
  @domain
end

#mime_formatObject (readonly)

Returns the value of attribute mime_format.



9
10
11
# File 'lib/tzispa/commands/rig.rb', line 9

def mime_format
  @mime_format
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/tzispa/commands/rig.rb', line 9

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/tzispa/commands/rig.rb', line 9

def type
  @type
end

Instance Method Details

#generateObject



19
20
21
22
23
24
# File 'lib/tzispa/commands/rig.rb', line 19

def generate
  Tzispa::Rig::Template.new(name: name,
                            type: type,
                            domain: domain,
                            format: mime_format).create
end