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
# Write a method that takes a string in and returns true if the letter | |
# "z" appears within three letters **after** an "a". You may assume | |
# that the string contains only lowercase letters. | |
# | |
# Difficulty: medium. | |
# may want to do max+1 as base-zero can be confusing | |
def x_after_y?(str, char1, char2, max) | |
range = Range.new(1, max) | |
str.slice!(str.chars.index(char1)) |
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
class Test | |
def initialize | |
@atts = Hash.new | |
end | |
def prop=(value) | |
@atts[:prop] = value | |
end | |
def prop |