-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for options to Daru module (#506)
* Add support for options to Daru module #476 #502 * Use the max_rows option on the terminal * fix typo in table formatter
- Loading branch information
Showing
4 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Daru | ||
# Defines constants and methods related to configuration | ||
module Configuration | ||
|
||
INSPECT_OPTIONS_KEYS = [ | ||
:max_rows, | ||
|
||
# Terminal | ||
:spacing, | ||
] | ||
|
||
# Jupyter | ||
DEFAULT_MAX_ROWS = 30 | ||
|
||
# Terminal | ||
DEFAULT_SPACING = 10 | ||
|
||
attr_accessor(*INSPECT_OPTIONS_KEYS) | ||
|
||
def configure | ||
yield self | ||
end | ||
|
||
def self.extended(base) | ||
base.reset_options | ||
end | ||
|
||
def reset_options | ||
self.max_rows = DEFAULT_MAX_ROWS | ||
|
||
self.spacing = DEFAULT_SPACING | ||
end | ||
end | ||
|
||
extend Configuration | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters