VK
Почитай well grounded rubyist, way of ruby, ruby under microscope
Size: a a a
VK
AI
A¯
module ForumUtils
class Utils
private
class CommandRunner
private
def execute_command(*command, failure_message: "", success_status_codes: [0], chdir: ".")
//my code
end
end
end
def
YD
YD
A¯
S
a, b[], c = tmp.split(",")
SD
a, b[], c = tmp.split(",")
a, *b, c =
S
YD
class A
def initialize(home)
@field = Dir.glob(...)
.select
.sort
. ...
.each_with_index do |f, i|
xxx
yyy
zzz
end
end
def a
# manipulate with @field
end
def b
# manipulate with @field
end
def c
# manipulate with @field
end
end
MC
AI
class A
def initialize(home)
@field = Dir.glob(...)
.select
.sort
. ...
.each_with_index do |f, i|
xxx
yyy
zzz
end
end
def a
# manipulate with @field
end
def b
# manipulate with @field
end
def c
# manipulate with @field
end
end
YD
class User < ActiveRecord::Base
def main_address
@main_address ||= begin
maybe_main_address = home_address if prefers_home_address?
maybe_main_address = work_address unless maybe_main_address
maybe_main_address = addresses.first unless maybe_main_address
end
end
end
YD
AI
YD
YD
MC
AI