module Easyfire::Renders::Helpers
Attributes
base_package[RW]
version[RW]
Public Instance Methods
extract_spec(spec)
click to toggle source
# File lib/easyfire/renders/helpers.rb, line 47 def extract_spec(spec) @spec = spec @name = spec.model_name.to_s @class_name_ef = spec.model_name.to_s + "EF" @service_class = spec.model_name.to_s + "ServiceEF" @object_name_ef = spec.model_name.to_s.uncapitalize + "EF" @collection_name = spec.model_name.to_s.underscore @declaration = "#{@class_name_ef} #{@object_name_ef}" @description = spec.description @attributes = spec.attributes @belongs_to = spec.associations @parents = spec.parents end
generate(template)
click to toggle source
# File lib/easyfire/renders/helpers.rb, line 61 def generate(template) ERB.new(template).result(binding) end
java_default_value(data_type)
click to toggle source
# File lib/easyfire/renders/helpers.rb, line 39 def java_default_value(data_type) @@java_defaults[data_type] || "null" end
swift_default_value(data_type)
click to toggle source
# File lib/easyfire/renders/helpers.rb, line 43 def swift_default_value(data_type) @@swift_defaults[data_type] end
type_to_java_value(data_type)
click to toggle source
# File lib/easyfire/renders/helpers.rb, line 31 def type_to_java_value(data_type) @@java_data_types[data_type] || data_type.to_s end
type_to_swift_value(data_type)
click to toggle source
# File lib/easyfire/renders/helpers.rb, line 34 def type_to_swift_value(data_type) @@swift_data_types[data_type] end