Class: GetYourRep::Base

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

Overview

Base class for external responses

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Accepts an options hash and creates setter and getter attribute methods from the hash keys. After initializing methods the values are added to the attributes. Taken with gratitude from davidbella gist.github.com/davidbella/6918455



8
9
10
11
12
13
14
# File 'lib/get_your_rep/responses/base.rb', line 8

def initialize(options = {})
  options.each do |attr, value|
    create_setters_from_opts(attr)
    create_getters_from_opts(attr)
    add_value_to_attr(attr, value)
  end
end