This file contains 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
module ActsAsWalker | |
attr_reader :distance | |
def walk! | |
@distance += 1 | |
end | |
end | |
module ActsAsSpeaker | |
attr_reader :speak, :gills |
This file contains 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
require 'active_model' | |
class Superhero | |
include ActiveModel::Validations | |
attr_accessor :name, :age | |
def initialize **args | |
@name = args[:name] |
This file contains 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
require 'active_model' | |
class Superhero | |
include ActiveModel::Validations | |
@@total = [] | |
attr_reader :name, :age | |
def initialize name, age | |
@name = name |
OlderNewer