lib/parser.rb in veda-apps-0.0.4 vs lib/parser.rb in veda-apps-0.0.5
- old
+ new
@@ -137,12 +137,11 @@
\t\t\t\treturn "id"
\t\t}
REALMCLASS
non_realm_funcs = <<-DEFAULT
-\t\tinit?(map: Map) {
-\t\t\t\tself.init()
+\t\trequired init?(map: Map) {
\t\t}
DEFAULT
# (map["friends"], ListTransform<User>())
attribute_literals = ""
mapping_literals = ""
@@ -160,13 +159,12 @@
end
attribute_literals += attribute_literal
mapping_literals += mapping_literal
end
-
class_model = <<-CLASS
import ObjectMapper
-import RealmSwift
+#{@realm? "import RealmSwift\nimport ObjectMapper_Realm" : ""}
class #{class_name}:#{@realm? " Object," : ""} Mappable {
#{attribute_literals}
#{@realm? realm_funcs : non_realm_funcs}
\t\tfunc mapping(map: Map) {