Class: MiniProperty
- Inherits:
-
Object
- Object
- MiniProperty
- Defined in:
- lib/sawa/MiniProperty.rb
Instance Method Summary collapse
- #has_mapped ⇒ Object
-
#initialize(row, sheet) ⇒ MiniProperty
constructor
A new instance of MiniProperty.
- #is_column ⇒ Object
- #is_manytoone ⇒ Object
- #is_onetomany ⇒ Object
- #is_onetoone ⇒ Object
- #is_searchkey ⇒ Object
- #is_string ⇒ Object
- #join_column ⇒ Object
- #jsonignore ⇒ Object
- #name ⇒ Object
- #nullable ⇒ Object
- #resource_name ⇒ Object
- #title ⇒ Object
- #type ⇒ Object
- #type_js ⇒ Object
- #unique ⇒ Object
Constructor Details
#initialize(row, sheet) ⇒ MiniProperty
Returns a new instance of MiniProperty.
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/sawa/MiniProperty.rb', line 2 def initialize(row, sheet) @row = row @sheet = sheet @idx_type = 1 @idx_name = 2 @idx_unique = 3 @idx_nullable = 4 @idx_jsonignore = 5 @idx_title = 6 @idx_mappedBy = 7 @idx_refColumn = 8 @idx_searchKey = 9 end |
Instance Method Details
#has_mapped ⇒ Object
65 66 67 |
# File 'lib/sawa/MiniProperty.rb', line 65 def has_mapped @row[@idx_mappedBy] == "1:1" or @row[@idx_mappedBy] == "1:n" or @row[@idx_mappedBy] == "n:1" end |
#is_column ⇒ Object
61 62 63 |
# File 'lib/sawa/MiniProperty.rb', line 61 def is_column @row[@idx_unique] != "-" end |
#is_manytoone ⇒ Object
77 78 79 |
# File 'lib/sawa/MiniProperty.rb', line 77 def is_manytoone @row[@idx_mappedBy] == "n:1" end |
#is_onetomany ⇒ Object
73 74 75 |
# File 'lib/sawa/MiniProperty.rb', line 73 def is_onetomany @row[@idx_mappedBy] == "1:n" end |
#is_onetoone ⇒ Object
81 82 83 |
# File 'lib/sawa/MiniProperty.rb', line 81 def is_onetoone @row[@idx_mappedBy] == "1:1" end |
#is_searchkey ⇒ Object
85 86 87 |
# File 'lib/sawa/MiniProperty.rb', line 85 def is_searchkey @row[@idx_searchKey] == "1" end |
#is_string ⇒ Object
28 29 30 |
# File 'lib/sawa/MiniProperty.rb', line 28 def is_string @row[@idx_type] == "java.lang.String" end |
#join_column ⇒ Object
69 70 71 |
# File 'lib/sawa/MiniProperty.rb', line 69 def join_column @row[@idx_refColumn] end |
#jsonignore ⇒ Object
53 54 55 |
# File 'lib/sawa/MiniProperty.rb', line 53 def jsonignore @row[@idx_jsonignore] == "1" end |
#name ⇒ Object
20 21 22 |
# File 'lib/sawa/MiniProperty.rb', line 20 def name @row[@idx_name] end |
#nullable ⇒ Object
49 50 51 |
# File 'lib/sawa/MiniProperty.rb', line 49 def nullable @row[@idx_nullable] == "1" end |
#resource_name ⇒ Object
16 17 18 |
# File 'lib/sawa/MiniProperty.rb', line 16 def resource_name @sheet.resource_path end |
#title ⇒ Object
57 58 59 |
# File 'lib/sawa/MiniProperty.rb', line 57 def title @row[@idx_title] end |
#type ⇒ Object
24 25 26 |
# File 'lib/sawa/MiniProperty.rb', line 24 def type @row[@idx_type] end |
#type_js ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sawa/MiniProperty.rb', line 32 def type_js if @row[@idx_type] == "java.lang.String" return "txt" end if @row[@idx_type] == "java.lang.Integer" or @row[@idx_type] == "java.lang.Short" or @row[@idx_type] == "java.lang.Long" or @row[@idx_type] == "java.lang.Float" or @row[@idx_type] == "java.lang.Double" return "num" end if @row[@idx_type].start_with?("java.util.List") return "list" end return "obj" end |
#unique ⇒ Object
45 46 47 |
# File 'lib/sawa/MiniProperty.rb', line 45 def unique @row[@idx_unique] == "1" end |