mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-struct: standardize block parameter spacing
changed block spacing from method{ to method { for consistency.
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ class Struct
|
||||
#
|
||||
# ISO 15.2.18.4.4
|
||||
def each(&block)
|
||||
self.class.members.each{|field|
|
||||
self.class.members.each {|field|
|
||||
block.call(self[field])
|
||||
}
|
||||
self
|
||||
@@ -24,7 +24,7 @@ class Struct
|
||||
#
|
||||
# ISO 15.2.18.4.5
|
||||
def each_pair(&block)
|
||||
self.class.members.each{|field|
|
||||
self.class.members.each {|field|
|
||||
block.call(field.to_sym, self[field])
|
||||
}
|
||||
self
|
||||
@@ -38,7 +38,7 @@ class Struct
|
||||
# ISO 15.2.18.4.7
|
||||
def select(&block)
|
||||
ary = []
|
||||
self.class.members.each{|field|
|
||||
self.class.members.each {|field|
|
||||
val = self[field]
|
||||
ary.push(val) if block.call(val)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user