Class: Tzispa::Command::Api

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, app) ⇒ Api



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

def initialize(name, app)
  @prj = Project.open
  raise "Application '#{app}' does not exists in project file" unless @prj.apps.include?(app)
  @domain = Tzispa::Domain.new app
  @name = name
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



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

def domain
  @domain
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#generateObject



17
18
19
# File 'lib/tzispa/command/api.rb', line 17

def generate
  Tzispa::Controller::Api.new.generate_handler(domain, name)
end