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.



30
31
32
# File 'lib/ObjCGenerator/types.rb', line 30

def varname
  @varname
end

Instance Method Details

#conversion_value(origin) ⇒ Object



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

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

#copyrow(newVarName) ⇒ Object



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

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

#default_valueObject



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

def default_value
  "NO"
end

#description_rowObject



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

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

#inEquality_test(other) ⇒ Object



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

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

#property_definitionObject



31
32
33
# File 'lib/ObjCGenerator/types.rb', line 31

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

#to_dictionary_itemObject



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

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