Class: Zusaar::Base
- Inherits:
-
Object
- Object
- Zusaar::Base
- Defined in:
- lib/zusaar/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attrs = {}) ⇒ Base
Returns a new instance of Base.
3 4 5 |
# File 'lib/zusaar/base.rb', line 3 def initialize(attrs = {}) @attrs = attrs end |
Class Method Details
.attr_reader(*attrs) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/zusaar/base.rb', line 8 def attr_reader(*attrs) attrs.each do |attribute| define_method attribute do @attrs[attribute.to_sym] || @attrs[attribute.to_s] end end end |