Class: BBRow

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-privacy/privacy/PrivacyModule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, is_comment = false, is_spec_start = false, is_spec_end = false) ⇒ BBRow

Returns a new instance of BBRow.



13
14
15
16
17
18
19
20
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 13

def initialize(content, is_comment=false, is_spec_start=false, is_spec_end=false)
  @content = content
  @is_comment = is_comment
  @is_spec_start = is_spec_start
  @is_spec_end = is_spec_end

  parse_key_value
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



11
12
13
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 11

def content
  @content
end

#is_commentObject

Returns the value of attribute is_comment.



11
12
13
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 11

def is_comment
  @is_comment
end

#is_spec_endObject

Returns the value of attribute is_spec_end.



11
12
13
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 11

def is_spec_end
  @is_spec_end
end

#is_spec_startObject

Returns the value of attribute is_spec_start.



11
12
13
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 11

def is_spec_start
  @is_spec_start
end

#keyObject

Returns the value of attribute key.



11
12
13
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 11

def key
  @key
end

#valueObject

Returns the value of attribute value.



11
12
13
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 11

def value
  @value
end

Instance Method Details

#parse_key_valueObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cocoapods-privacy/privacy/PrivacyModule.rb', line 22

def parse_key_value
  # 在这里添加提取 key 和 value 的逻辑
  if @content.include?('=')
    key_value_split = @content.split('=')
    @key = key_value_split[0]
    @value = key_value_split[1..-1].join('=')
  else
    @key = nil
    @value = nil
  end
end