Sha256: db502af660ca1a66cfe5900fd092b4bd23289d1c28f8cdcf302541131bf1f4bd

Contents?: true

Size: 600 Bytes

Versions: 6

Compression:

Stored size: 600 Bytes

Contents

require "tilt/haml"
require "tilt/erb"
require "haml"
class Hello < Cognition::Plugins::Base
  match "hello", :hello, help: {
    "hello" => "Returns Hello World"
  }

  def hello(*)
    "Hello World"
  end

  def hi(*)
    @message = "Hi"
    render
  end

  def hola(*)
    @message = "Hola"
    render(template: File.expand_path("../hello/views/hola.haml", __FILE__))
  end

  def bonjour(*)
    @message = "Bonjour"
    render(type: "text")
  end

  def hey(*)
    @message = "Hey"
    render(extension: "haml")
  end

  def yo(*)
    @message = "Yo"
    render(locals: { num_yos: 3 })
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cognition-2.1.3 test/fixtures/hello.rb
cognition-2.1.2 test/fixtures/hello.rb
cognition-2.0.8 test/fixtures/hello.rb
cognition-2.0.7 test/fixtures/hello.rb
cognition-2.0.6 test/fixtures/hello.rb
cognition-2.0.5 test/fixtures/hello.rb