Class: Gitrb::GitObject
- Inherits:
-
Object
- Object
- Gitrb::GitObject
- Defined in:
- lib/gitrb/gitobject.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#repository ⇒ Object
Returns the value of attribute repository.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GitObject
constructor
A new instance of GitObject.
- #object ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ GitObject
Returns a new instance of GitObject.
5 6 7 8 |
# File 'lib/gitrb/gitobject.rb', line 5 def initialize( = {}) @repository = [:repository] @id = [:id] end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/gitrb/gitobject.rb', line 3 def id @id end |
#repository ⇒ Object
Returns the value of attribute repository.
3 4 5 |
# File 'lib/gitrb/gitobject.rb', line 3 def repository @repository end |
Class Method Details
.factory(type, *args) ⇒ Object
20 21 22 23 24 |
# File 'lib/gitrb/gitobject.rb', line 20 def self.factory(type, *args) klass = @types[type] raise NotImplementedError, "Object type not supported: #{type}" if !klass klass.new(*args) end |
.inherited(subclass) ⇒ Object
16 17 18 |
# File 'lib/gitrb/gitobject.rb', line 16 def self.inherited(subclass) @types[subclass.name[7..-1].downcase] = subclass end |
Instance Method Details
#object ⇒ Object
10 11 12 |
# File 'lib/gitrb/gitobject.rb', line 10 def object self end |