こんなことでお困りの時は、お気軽に issue を作っていただければ、何かお力になれるかもしれません。
- Crystal 本体や Crystal 関連のライブラリに問題を見つけたけど、本家のリポジトリに報告すべきか悩むとき。(bugs ラベルを付ける)
- Crystal 本体や Crystal 関連のライブラリに要求したい機能があるけど、本家のリポジトリで話し合う前に意見を求めたいとき。(features ラベルを付ける)
puts "Hello, World" | |
STDOUT.puts "Hello, World" | |
class Point | |
property :x, :y | |
def initialize(@x, @y) | |
end | |
end |
package main | |
import ( | |
"fmt" | |
) | |
type User struct { | |
Name string | |
} |
class A | |
def say | |
puts "A" | |
end | |
end | |
module B | |
def self.role(klass, &block) | |
ref = refine(klass) { } | |
ref.module_eval(&block) |
# 役者クラス | |
# | |
# say: 役者は声を発する事ができる。 | |
class Actor | |
def say(words) | |
puts words | |
end | |
end |
require 'unextend' | |
class Person | |
attr_accessor :husbund, :wife | |
def help(other) | |
... | |
end | |
def tell_love(other) |
# 記事クラス | |
class Article < AR::Base | |
belongs_to :user | |
end |
FactoryGirl.define do | |
factory :user do | |
tasks do |user| | |
[ | |
FactoryGirl.create(:task, user: user) | |
] | |
end | |
end | |
end |
jQuery.fn.extend({ | |
/** | |
* $('li').tapp() で console.debug に this を出力します。 | |
* | |
* func を与えることで、func(this) を実行した結果を console.debug に出力します。 | |
* | |
* @this {jQuery} | |
* @param {function(jQuery)=} func | |
* @return {jQuery} | |
*/ |
class Class | |
def new_type(&block) | |
new_class = self.dup | |
new_class.class_eval(&block) if block_given? | |
new_class | |
end | |
end | |
CArray = Array.new_type do | |
def example |