Class: Headdesk::Apk::Resources

Inherits:
Object
  • Object
show all
Defined in:
lib/headdesk/apk/resources.rb

Overview

Android Resources searching

Defined Under Namespace

Classes: XmlCollection

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Resources

Returns a new instance of Resources.



11
12
13
# File 'lib/headdesk/apk/resources.rb', line 11

def initialize(path)
  @path = path
end

Instance Method Details

#file?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/headdesk/apk/resources.rb', line 19

def file?(file_name)
  File.exist? path_for(file_name)
end

#path_for(file_name) ⇒ Object



23
24
25
# File 'lib/headdesk/apk/resources.rb', line 23

def path_for(file_name)
  "#{@path}/#{file_name.sub(%r{^\/}, '')}"
end

#values(modifiers = {}) ⇒ Object



15
16
17
# File 'lib/headdesk/apk/resources.rb', line 15

def values(modifiers = {})
  XmlCollection.new(@path, 'values', modifiers)
end