Skip to content

Instantly share code, notes, and snippets.

@ro31337
Created November 7, 2017 05:14
Show Gist options
  • Select an option

  • Save ro31337/3bf98bc7bdb8aa57f17e653ed66dbf93 to your computer and use it in GitHub Desktop.

Select an option

Save ro31337/3bf98bc7bdb8aa57f17e653ed66dbf93 to your computer and use it in GitHub Desktop.
class Plan
def price
100
end
end
class Promo
def initialize(origin, code)
@origin = origin
@code = code
end
def price
@origin.price * 0.9
end
end
class PayPerYear
def initialize(origin)
@origin = origin
end
def price
@origin.price * 0.9
end
end
final_plan = PayPerYear.new(
Promo.new(
Plan.new,
'SBERBANK'
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment