Skip to content

Instantly share code, notes, and snippets.

@imownbey
Created August 4, 2009 04:59
Show Gist options
  • Save imownbey/161033 to your computer and use it in GitHub Desktop.
Save imownbey/161033 to your computer and use it in GitHub Desktop.
class StringHolder
def initialize(a_string)
@the_string = a_string
end
def get_that_string
puts @the_string
end
def self.stupid_method(a_string)
puts "this method doesnt do anything"
end
end
#> string_holder_variable = StringHolder.new("this is my string!")
#> string_holder_variable.get_that_string ###===> This will print out "this is my string!"
#> another_string = StringHolder.new("this is another trhing!")
#> another_string.get_that_string ###===> This will print out "this is another trhing!"
#> StringHolder.stupid_method("this argument doesnt matter") ###===> This will print out "this method eoesnt do anything"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment