This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = Shipment.new | |
if s.respond_to?(:cancel_shipping) | |
s.cancel_shipping | |
else | |
puts "Oh no ! Shipment cannot be cancel." | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = Shipment.new | |
if s.respond_to?(:tracking_code) | |
s.send(:tracking_code, '123ABC') # or s.send('cancel_shipping', '123ABC') | |
else | |
puts "Tracking code is not available." | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Shipment | |
define_method :cancel do |reason| | |
@cancelled = true | |
puts reason | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We create a container class. We only store the product's name at instantiation | |
class Container | |
attr :product_name | |
def initialize(name) | |
@product_name = name | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.12.14.0/23 | |
1.12.32.0/23 | |
1.14.0.0/15 | |
1.44.96.0/24 | |
1.116.0.0/15 | |
1.178.32.0/19 | |
1.247.4.0/24 | |
1.255.30.0/24 | |
2.56.8.0/23 | |
2.56.16.0/22 |
OlderNewer