Class: Moblues::Generator::Base::Type
- Inherits:
-
Object
- Object
- Moblues::Generator::Base::Type
- Defined in:
- lib/moblues/generator/base/type.rb
Direct Known Subclasses
Constant Summary collapse
- SWIFT =
{ attribute_types: { string: 'String', number: 'NSNumber', decimal: 'NSDecimalNumber', date: 'NSDate', data: 'NSData', id: 'AnyObject' }, relationship_types: { to_many: 'NSSet', to_many_ordered: 'NSOrderedSet', suffix: '' } }
- OBJC =
{ attribute_types: { string: 'NSString *', number: 'NSNumber *', decimal: 'NSDecimalNumber *', date: 'NSDate *', data: 'NSData *', id: 'id ' }, relationship_types: { to_many: 'NSSet *', to_many_ordered: 'NSOrderedSet *', suffix: ' *' } }
Instance Method Summary collapse
- #attribute_type(attribute) ⇒ Object
-
#initialize(params = SWIFT) ⇒ Type
constructor
A new instance of Type.
- #relationship_type(relationship) ⇒ Object
Constructor Details
Instance Method Details
#attribute_type(attribute) ⇒ Object
46 47 48 |
# File 'lib/moblues/generator/base/type.rb', line 46 def attribute_type(attribute) attribute_types.fetch(attribute.type) end |
#relationship_type(relationship) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/moblues/generator/base/type.rb', line 50 def relationship_type(relationship) if relationship.to_many relationship.ordered ? relationship_types[:to_many_ordered] : relationship_types[:to_many] else relationship.destination_entity + relationship_types[:suffix] end end |