Class: Tzispa::Command::Rig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Rig.



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

def initialize(name, app, type, mime_format = nil)
  @prj = Project.open
  raise "Application '#{app}' does not exists in project file" unless @prj.apps.include?(app)
  @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.



8
9
10
# File 'lib/tzispa/command/rig.rb', line 8

def domain
  @domain
end

#mime_formatObject (readonly)

Returns the value of attribute mime_format.



8
9
10
# File 'lib/tzispa/command/rig.rb', line 8

def mime_format
  @mime_format
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/tzispa/command/rig.rb', line 8

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/tzispa/command/rig.rb', line 8

def type
  @type
end

Instance Method Details

#generateObject



19
20
21
# File 'lib/tzispa/command/rig.rb', line 19

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