Class: ExtractingId::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/extracting_id.rb

Direct Known Subclasses

Restore, Segue, Storyboard

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Type

Returns a new instance of Type.



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

def initialize(name)
  @name = name
end

Instance Method Details

#==(type) ⇒ Object



59
60
61
# File 'lib/extracting_id.rb', line 59

def == (type)
  @name == type.name
end

#capitalizeObject



65
66
67
68
# File 'lib/extracting_id.rb', line 65

def capitalize
  c = @name
  c[0,1].capitalize + c[1..-1]
end

#defineObject



69
70
71
# File 'lib/extracting_id.rb', line 69

def define
  "k" + self.class_name + self.capitalize
end

#impDefineObject



75
76
77
# File 'lib/extracting_id.rb', line 75

def impDefine
  "\#define #{self.define} #{self.nsString}\n"
end

#nameObject



62
63
64
# File 'lib/extracting_id.rb', line 62

def name
  @name
end

#nsStringObject



72
73
74
# File 'lib/extracting_id.rb', line 72

def nsString
  '@"' + @name + '"'
end