-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
405f41b
commit 28e5081
Showing
4 changed files
with
146 additions
and
98 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
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,44 @@ | ||
module Esquema | ||
class VirtualColumn | ||
def initialize(property_name, options = {}) | ||
@property_name = property_name | ||
@options = options | ||
end | ||
|
||
def name | ||
@property_name.to_s | ||
end | ||
|
||
def class_name | ||
@property_name.to_s.classify | ||
end | ||
|
||
def type | ||
@options[:type] | ||
end | ||
|
||
def item_type | ||
@options.dig(:items, :type) | ||
end | ||
|
||
def default | ||
@options[:default] | ||
end | ||
|
||
def title | ||
@options[:title] | ||
end | ||
|
||
def description | ||
@options[:description] | ||
end | ||
|
||
def columns | ||
[] | ||
end | ||
|
||
def collection? | ||
@options[:type] == :array | ||
end | ||
end | ||
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