Class: Repositor::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/repositor/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model: nil) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/repositor/base.rb', line 7

def initialize(model: nil)
  @model = model || self.class.to_s.chomp(self.class::TYPE).singularize.constantize
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



5
6
7
# File 'lib/repositor/base.rb', line 5

def model
  @model
end