This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/lib/orbit_app/summary.rb

46 lines
782 B
Ruby
Raw Normal View History

2012-09-13 10:31:44 +00:00
module OrbitApp
module Summary
Version = "0.1"
module ClassMethods
@@summaries = []
def new( name ,&block)
@@summaries << Item.new(name,&block)
# binding.pry
2012-09-13 10:31:44 +00:00
end
def all
return @@summaries
end
end
extend ClassMethods
def self.included( other )
other.extend( ClassMethods )
end
# def initialize( k )
# @@summaries += 1
# binding.pry
# end
class Item
@name =""
def initialize(name = "test",&block)
@name = name
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
def get_name
return @name
end
end
end
end