Class: Resources::StringResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/robjc/resources/string_resource.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#path

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Resources::Resource

Instance Attribute Details

#stringsObject (readonly)

Returns the value of attribute strings.



6
7
8
# File 'lib/robjc/resources/string_resource.rb', line 6

def strings
  @strings
end

Instance Method Details

#method_name(string) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/robjc/resources/string_resource.rb', line 12

def method_name(string)
  components = string.split('_')
  string = components.first.downcase
  if components.length == 1
    string
  else
    components.each_with_index do |s, i|
      next if i == 0
      string += s.capitalize
    end
  end
  string
end