Class: Tzispa::Command::Rig
- Inherits:
-
Object
- Object
- Tzispa::Command::Rig
- Defined in:
- lib/tzispa/command/rig.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#mime_format ⇒ Object
readonly
Returns the value of attribute mime_format.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(name, app, type, mime_format = nil) ⇒ Rig
constructor
A new instance of Rig.
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
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
8 9 10 |
# File 'lib/tzispa/command/rig.rb', line 8 def domain @domain end |
#mime_format ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/tzispa/command/rig.rb', line 8 def name @name end |
#type ⇒ Object (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
#generate ⇒ Object
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 |