class Apiotics::ChannelGenerator

Public Instance Methods

copy_channel_files() click to toggle source
# File lib/generators/apiotics/channel/channel_generator.rb, line 6
def copy_channel_files
  template "apiotics_channel.rb.erb", "app/channels/#{module_file_name}_channel.rb"
  template "apiotics_channel_client.coffee.erb", "app/assets/javascripts/channels/#{module_file_name}.coffee"
  template "apiotics_channel_initializer.rb.erb", "config/initializers/apiotics_channel.rb"
  route "mount ActionCable.server => '/cable'"
end

Private Instance Methods

class_name() click to toggle source
# File lib/generators/apiotics/channel/channel_generator.rb, line 23
def class_name
  name.classify
end
file_name() click to toggle source
# File lib/generators/apiotics/channel/channel_generator.rb, line 15
def file_name
  name.underscore
end
module_file_name() click to toggle source
# File lib/generators/apiotics/channel/channel_generator.rb, line 19
def module_file_name
  parent.underscore
end
module_name() click to toggle source
# File lib/generators/apiotics/channel/channel_generator.rb, line 27
def module_name
  parent.classify
end
table_prefix() click to toggle source
# File lib/generators/apiotics/channel/channel_generator.rb, line 31
def table_prefix
  parent.underscore + "_"
end