class Sample
Constants
- MY_CONST
Public Class Methods
my_array()
click to toggle source
doc for Sample.my_array
# File lib/ruby_gem.rb, line 23 def self.my_array [1, 2, 'three'] end
my_bool()
click to toggle source
doc for Sample.my_bool
# File lib/ruby_gem.rb, line 13 def self.my_bool true end
my_hash()
click to toggle source
doc for Sample.my_hash
# File lib/ruby_gem.rb, line 18 def self.my_hash {:a => 1, 'b' => 'two'} end
my_int()
click to toggle source
doc for Sample.my_int
# File lib/ruby_gem.rb, line 8 def self.my_int 123 end
my_string()
click to toggle source
doc for Sample.my_string
# File lib/ruby_gem.rb, line 3 def self.my_string "some string" end
new(i)
click to toggle source
# File lib/ruby_gem.rb, line 27 def initialize(i) @i = i end
Public Instance Methods
my_method(a, b)
click to toggle source
# File lib/ruby_gem.rb, line 31 def my_method(a, b) c = 3 b = 'four' l = b.length puts "#{@i}: #{b} has length #{l} (a=#{a}, b=#{b})" @i += 1 end