`
tom_cjp
  • 浏览: 43157 次
  • 性别: Icon_minigender_1
  • 来自: 温州
文章分类
社区版块
存档分类
最新评论
文章列表
p "Be locked." and return if locked? p "no return!" 运行后出现 "Be locked." "no return!"
class Taste attr soybean_sauce, pepper, glutamate def initialize(soybean_sauce, pepper, glutamate) @soybean_sauce = soybean_sauce @pepper = pepper @glutamate = glutamate end def display puts "菜的调料含量: 酱油#{@soybean_sauce}, 辣椒#{@pepper},味精#{glutamate}" ...
Firefox 圆角: -moz-border-radius: 1.6em; Safari 3圆角: -webkit-border-radius: 1.6em; <style type="text/css"> body { font: Arial, Helvetica, sans-serif; font-size: 17px; color: #fff; line-height: 2; margin: 0; padding: 0; } .box { width: 30em; padding: 1em 4em ...
class Director def initialize @process = [:create_ear, :create_body, :create_tail] end def build(builder) @process.each do |p| builder.send(p) end end end class Humanbuider def create_ear raise 'Abastract method' end def create_body raise ...
class Record def add_record raise 'Abastract method' end end class Event < Record def add_record puts '增加一条日志' end end class OrderEvent < Record attr_accessor :event def initialize @event = Event.new end def add_record puts '给订单' @e ...
module Hair def render raise "Abstract method" end end module Eye def render raise "Abstract method" end end class LongHair include Hair def render puts '长头发' end end class ShortHair include Hair def render puts '短头发 ...
class Place def rent puts "oh, don't call me" end end class House < Place def rent puts "make rent" end end class HouseAgency < Place attr :real_place def rent puts "rise 100% in price" @real_place ||= House.new ...
Global site tag (gtag.js) - Google Analytics