Class: Zusaar::Base

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

Direct Known Subclasses

Identity, SearchResults

Class Method Summary collapse

Instance Method Summary collapse

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