Class: Malartu::Portfolio
- Inherits:
-
MalartuObject
- Object
- MalartuObject
- Malartu::Portfolio
- Defined in:
- lib/malartu/portfolio.rb
Overview
A portfolio is how groups track companies within Malartu
Instance Attribute Summary collapse
-
#connections ⇒ Object
Returns the value of attribute connections.
-
#path ⇒ Object
Returns the value of attribute path.
Attributes inherited from MalartuObject
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ Portfolio
constructor
A new instance of Portfolio.
Methods inherited from MalartuObject
Constructor Details
#initialize(json) ⇒ Portfolio
Returns a new instance of Portfolio.
5 6 7 8 9 10 11 12 13 |
# File 'lib/malartu/portfolio.rb', line 5 def initialize(json) super define_singleton_method('connections') do json['connections'].map do |c| Malartu::Connection.new(c) end end if json['connections'] define_singleton_method('path') { json['path'] || "/v0/kpi/portfolios/#{sid}" } end |
Instance Attribute Details
#connections ⇒ Object
Returns the value of attribute connections.
4 5 6 |
# File 'lib/malartu/portfolio.rb', line 4 def connections @connections end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/malartu/portfolio.rb', line 4 def path @path end |