Class: TypeBool

Inherits:
ObjCType show all
Defined in:
lib/ObjCGenerator/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ObjCType

#initialize

Constructor Details

This class inherits a constructor from ObjCType

Instance Attribute Details

#varnameObject

Returns the value of attribute varname.



33
34
35
# File 'lib/ObjCGenerator/types.rb', line 33

def varname
  @varname
end

Instance Method Details

#conversion_value(origin) ⇒ Object



41
42
43
# File 'lib/ObjCGenerator/types.rb', line 41

def conversion_value origin
  "[#{origin} boolValue]"
end

#copyrow(newVarName) ⇒ Object



53
54
55
# File 'lib/ObjCGenerator/types.rb', line 53

def copyrow newVarName
  "#{newVarName}.#{self.varname}  = self.#{self.varname};"
end

#default_valueObject



37
38
39
# File 'lib/ObjCGenerator/types.rb', line 37

def default_value
  "NO"
end

#description_rowObject



50
51
52
# File 'lib/ObjCGenerator/types.rb', line 50

def description_row
  "@\"self.#{self.varname} = %@\" , self.#{self.varname} ? @\"YES\" : @\"NO\""
end

#hash_rowObject



56
57
58
# File 'lib/ObjCGenerator/types.rb', line 56

def hash_row
  "(self.#{self.varname}?1231:1237);"
end

#inEquality_test(other) ⇒ Object



47
48
49
# File 'lib/ObjCGenerator/types.rb', line 47

def inEquality_test other
  "self.#{self.varname}  != #{other}.#{self.varname}"
end

#property_definitionObject



34
35
36
# File 'lib/ObjCGenerator/types.rb', line 34

def property_definition
  "@property (nonatomic) BOOL #{@varname};"
end

#to_dictionary_itemObject



44
45
46
# File 'lib/ObjCGenerator/types.rb', line 44

def to_dictionary_item
  "@\"#{@varname}\" : @(self.#{@varname})  ?: @(YES)"
end