This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: sinatra-test.rb | |
# Create Day is 2015/05/08 | |
# Last Update Day is 2015/05/14 | |
# Gem List | |
gem 'tilt', '1.4.1' | |
# Require List | |
require 'sinatra' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
-# %TagName(html)で記述 | |
%html{:lang => "ja"} | |
%head | |
-# 「%TagName= @EmmbeddingName」で出力 | |
%title= @title | |
%body | |
-# 「%TagName #{@EmmbeddingName}で出力」 | |
%h1 #{@title} | |
%p= @text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: sinatra_test.rb | |
# Create Day is 2015/05/08 | |
# Last Update Day is 2015/05/14 | |
# Gem List | |
gem 'tilt', '1.4.1' | |
# Require List | |
require 'sinatra' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html{:lang => "ja"} | |
%head | |
%title= @title | |
%body | |
%h1 #{@title} | |
%p= @text | |
%form{:method => "POST", :action => '/request_print'} | |
%input{:type => "hidden", :name => "_method", :value => "PUT"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html{:lang => "ja"} | |
%head | |
%title Request Print | |
%body | |
%p= "method: #{@request_method}" | |
%p= "url: #{@request_url}" | |
%p= "path: #{@request_path}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: main1.rb | |
# Create Day is 2015/05/17 | |
# Last Update Day is 2015/05/17 | |
# クラス | |
class TestClass | |
# 初期化関数 | |
def initialize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: main2.rb | |
# Create Day is 2015/05/17 | |
# Last Update Day is 2015/05/17 | |
# スーパークラス | |
class SuperClass | |
# 初期化関数 | |
def initialize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: main3.rb | |
# Create Day is 2015/05/17 | |
# Last Update Day is 2015/05/17 | |
# モジュール | |
module ModuleTest | |
def test_method | |
puts "test1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: main4.rb | |
# Create Day is 2015/05/17 | |
# Last Update Day is 2015/05/17 | |
# その他 | |
class SuperOther | |
def initialize(private_text="private", protected_text="protected", public_text="public") | |
@private_text = private_text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# File Name: sinatra_test.rb | |
# Create Day is 2015/05/08 | |
# Last Update Day is 2015/05/14 | |
# Gem List | |
gem 'tilt', '1.4.1' | |
# Require List | |
require 'sinatra' |