There are two ways to insert a Module above the objects singleton class but before the objects Class.
# You can open the class definition body of a singleton class and add instance methods, class methods, and constants.
# You do this by using the 'class' keyword and a CONSTANT
class C
def hello
puts "this is a hello yo."
end
end
module M
def talk
puts "hello."
end
end
# Example 1
example1 = C.new
class << example1
include M
end
# Call the Singleton method
example1.hello
# Call the Module Mix-in
example1.talk
# Example 2
example2 = C.new
example2.extend(M)
example2.talk
Deploying Rails 5.x on AWS ElasticBeanstalk using AWS CodeCommit
How to deploy your Rails app on ElasticBeanstalk (including S3 buckets, security groups, load balancers, auto-scalling groups and more) using CodeCommit.
Subscribe to new posts
Processing your application
Please check your inbox and click the link to confirm your subscription
There was an error sending the email