Class: Everypolitician::Entity
- Inherits:
-
Object
- Object
- Everypolitician::Entity
- Defined in:
- lib/everypolitician.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(data) ⇒ Entity
constructor
A new instance of Entity.
-
#process_data(data) ⇒ Object
Override in subclasses to change structure of data.
Constructor Details
#initialize(data) ⇒ Entity
Returns a new instance of Entity.
33 34 35 36 37 38 39 |
# File 'lib/everypolitician.rb', line 33 def initialize(data) process_data(data).each do |key, value| define_singleton_method(key) do value end end end |
Instance Method Details
#process_data(data) ⇒ Object
Override in subclasses to change structure of data
42 43 44 |
# File 'lib/everypolitician.rb', line 42 def process_data(data) data end |