Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
6421bb70
Commit
6421bb70
authored
Dec 15, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add :meta_column to module JsonColumn
parent
75f6195a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
json_column.rb
lib/shotengai/json_column.rb
+5
-3
No files found.
lib/shotengai/json_column.rb
View file @
6421bb70
...
@@ -109,9 +109,11 @@ module Shotengai
...
@@ -109,9 +109,11 @@ module Shotengai
}
}
end
end
# TODO:ORNOT:
def
meta_column
column
,
default:
nil
,
trans:
Proc
.
new
(
&
:itself
)
def
hash_column
# json column using for code development
# like meta, detail these json using for code development
define_method
(
:meta
)
{
super
()
||
{}
}
define_method
(
column
)
{
trans
.
call
(
meta
[
column
.
to_s
]
||
default
)
}
define_method
(
"
#{
column
}
="
)
{
|
val
|
self
.
meta
=
meta
.
merge
(
column
.
to_s
=>
val
)
}
end
end
# def custom_hash_columns columns, options={}
# def custom_hash_columns columns, options={}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment