Class: GM::GlobalNote

Inherits:
Note
  • Object
show all
Defined in:
lib/cocoapods-byte-csjm/gm.rb

Instance Attribute Summary collapse

Attributes inherited from Note

#auto_load, #auto_update, #load_detect

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Note

#get_update

Constructor Details

#initialize(auto_load = true, auto_update = GM::BuildConfig.update_value_last_version, load_detect = true, auto_load_whitelist = []) ⇒ GlobalNote

Returns a new instance of GlobalNote.



95
96
97
98
99
100
# File 'lib/cocoapods-byte-csjm/gm.rb', line 95

def initialize(auto_load = true , auto_update = GM::BuildConfig.update_value_last_version, load_detect = true, auto_load_whitelist = [])
  @auto_load = auto_load
  @auto_update = get_update auto_update
  @load_detect = load_detect
  @auto_load_whitelist = auto_load_whitelist
end

Instance Attribute Details

#auto_load_whitelistObject

Returns the value of attribute auto_load_whitelist.



94
95
96
# File 'lib/cocoapods-byte-csjm/gm.rb', line 94

def auto_load_whitelist
  @auto_load_whitelist
end

Class Method Details

.from_hash(hash) ⇒ Object



119
120
121
122
123
124
125
126
# File 'lib/cocoapods-byte-csjm/gm.rb', line 119

def self.from_hash(hash)
  global_note =  GlobalNote.new()
  global_note.auto_load = hash["AUTO_LOAD"] if hash.has_key?("AUTO_LOAD")
  global_note.auto_update = hash["AUTO_UPDATE"] if hash.has_key?("AUTO_UPDATE")
  global_note.load_detect = hash["LOAD_DETECT"] if hash.has_key?("LOAD_DETECT")
  global_note.auto_load_whitelist = hash["AUTO_LOAD_WHITELIST"] if hash.has_key?("AUTO_LOAD_WHITELIST")
  global_note
end

Instance Method Details

#has_set_load?(adn_name) ⇒ Boolean

Returns:

  • (Boolean)


102
103
104
105
106
107
108
# File 'lib/cocoapods-byte-csjm/gm.rb', line 102

def has_set_load?(adn_name)
  adn_name = Pod::Specification.root_name(adn_name)
  if @auto_load_whitelist.size == 0 || @auto_load_whitelist.include?(adn_name)
    return true
  end
  false
end

#to_hashObject



110
111
112
113
114
115
116
117
# File 'lib/cocoapods-byte-csjm/gm.rb', line 110

def to_hash
  hash = {}
  hash["AUTO_LOAD"] = @auto_load
  hash["AUTO_UPDATE"] = @auto_update
  hash["LOAD_DETECT"] = @load_detect
  hash["AUTO_LOAD_WHITELIST"] = @auto_load_whitelist
  hash
end