Class: Acouchi::Configuration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#activityObject

Returns the value of attribute activity.



3
4
5
# File 'lib/acouchi/configuration.rb', line 3

def activity
  @activity
end

#apkObject

Returns the value of attribute apk.



3
4
5
# File 'lib/acouchi/configuration.rb', line 3

def apk
  @apk
end

#deviceObject

Returns the value of attribute device.



3
4
5
# File 'lib/acouchi/configuration.rb', line 3

def device
  @device
end

#portObject

Returns the value of attribute port.



3
4
5
# File 'lib/acouchi/configuration.rb', line 3

def port
  @port
end

#project_pathObject

Returns the value of attribute project_path.



3
4
5
# File 'lib/acouchi/configuration.rb', line 3

def project_path
  @project_path
end

#target_packageObject

Returns the value of attribute target_package.



3
4
5
# File 'lib/acouchi/configuration.rb', line 3

def target_package
  @target_package
end

Class Method Details

.from_json(json) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/acouchi/configuration.rb', line 5

def self.from_json json
  require "json"
  json = JSON.parse(json)
  configuration = Configuration.new
  configuration.target_package = json["target_package"]
  configuration.activity       = json["activity"]
  configuration.project_path   = json["project_path"]
  configuration.apk            = json["apk"]
  configuration.device         = json["device"]
  configuration.port           = json["port"] || 7103
  configuration
end