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.
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)
|
2012-11-20 07:56:52 +00:00
|
|
|
# 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
|