Skip to content

Commit ed58120

Browse files
committed
Enable method chain style setting of Plot or Diagram
1 parent 8cfd260 commit ed58120

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/nyaplot/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def define_properties(*symbols)
4141
define_method(symbol) {|val=nil|
4242
return @properties[symbol] if val.nil?
4343
@properties[symbol] = val
44+
return self
4445
}
4546
end
4647
end
@@ -61,6 +62,7 @@ def define_group_properties(name, symbols)
6162
define_method(symbol) {|val=nil|
6263
return @properties[name][symbol] if val.nil?
6364
@properties[name][symbol] = val
65+
return self
6466
}
6567
end
6668
end

0 commit comments

Comments
 (0)