Class: Hap::Generators::Endpoint

Inherits:
Thor::Group
  • Object
show all
Includes:
Helpers
Defined in:
lib/hap/generators/endpoint.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/hap/generators/endpoint.rb', line 10

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#copy_endpoint_templateObject



14
15
16
# File 'lib/hap/generators/endpoint.rb', line 14

def copy_endpoint_template
  template("templates/endpoint.erb", "#{Hap.app_root}/#{Hap::ENDPOINTS_DIR}/#{name}.rb")
end

#create_config_fileObject



18
19
20
# File 'lib/hap/generators/endpoint.rb', line 18

def create_config_file
  create_file "#{Hap.app_root}/#{Hap::CONFIG_DIR}/#{name}.rb", ""
end

#create_remote_appObject



22
23
24
# File 'lib/hap/generators/endpoint.rb', line 22

def create_remote_app
  create_app name if options[:remote]
end