Class: Tarpon::Entity::Offerings
- Inherits:
-
Object
- Object
- Tarpon::Entity::Offerings
- Includes:
- Enumerable
- Defined in:
- lib/tarpon/entity/offerings.rb
Instance Attribute Summary collapse
-
#current_offering_id ⇒ Object
readonly
Returns the value of attribute current_offering_id.
-
#offerings ⇒ Object
readonly
Returns the value of attribute offerings.
Instance Method Summary collapse
- #[](identifier) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(current_offering_id:, offerings:) ⇒ Offerings
constructor
A new instance of Offerings.
Constructor Details
#initialize(current_offering_id:, offerings:) ⇒ Offerings
Returns a new instance of Offerings.
12 13 14 15 16 17 |
# File 'lib/tarpon/entity/offerings.rb', line 12 def initialize(current_offering_id:, offerings:, **) @current_offering_id = current_offering_id @offerings = offerings.each_with_object({}) do |offering, map| map[offering[:identifier].to_sym] = Tarpon::Entity::Offering.new(**offering) end end |
Instance Attribute Details
#current_offering_id ⇒ Object (readonly)
Returns the value of attribute current_offering_id.
10 11 12 |
# File 'lib/tarpon/entity/offerings.rb', line 10 def current_offering_id @current_offering_id end |
#offerings ⇒ Object (readonly)
Returns the value of attribute offerings.
10 11 12 |
# File 'lib/tarpon/entity/offerings.rb', line 10 def offerings @offerings end |
Instance Method Details
#[](identifier) ⇒ Object
23 24 25 |
# File 'lib/tarpon/entity/offerings.rb', line 23 def [](identifier) @offerings[identifier.to_sym] end |
#each(&block) ⇒ Object
19 20 21 |
# File 'lib/tarpon/entity/offerings.rb', line 19 def each(&block) @offerings.each(&block) end |