Class: GetYourRep::Base
- Inherits:
-
Object
- Object
- GetYourRep::Base
- Defined in:
- lib/get_your_rep/responses/base.rb
Overview
Base class for external responses
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
Accepts an options hash and creates setter and getter attribute methods from the hash keys.
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( = {}) .each do |attr, value| create_setters_from_opts(attr) create_getters_from_opts(attr) add_value_to_attr(attr, value) end end |