Class: Socialoud::Services::Base
- Inherits:
-
Object
- Object
- Socialoud::Services::Base
- Defined in:
- lib/socialoud/services.rb
Instance Attribute Summary collapse
-
#aggregator ⇒ Object
readonly
Returns the value of attribute aggregator.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data, aggr = nil) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method, *args) ⇒ Object
- #set(key, value) ⇒ Object
- #setup! ⇒ Object
Constructor Details
#initialize(data, aggr = nil) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/socialoud/services.rb', line 6 def initialize(data, aggr = nil) @data = data @aggregator = aggr end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/socialoud/services.rb', line 18 def method_missing(method, *args) if args.length > 0 @data[method.to_s].send(args.shift, *args) else @data[method.to_s] end end |
Instance Attribute Details
#aggregator ⇒ Object (readonly)
Returns the value of attribute aggregator.
4 5 6 |
# File 'lib/socialoud/services.rb', line 4 def aggregator @aggregator end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/socialoud/services.rb', line 4 def data @data end |
Instance Method Details
#set(key, value) ⇒ Object
14 15 16 |
# File 'lib/socialoud/services.rb', line 14 def set(key, value) @data[key] = value end |
#setup! ⇒ Object
11 12 |
# File 'lib/socialoud/services.rb', line 11 def setup! end |