Class: AppInfo::Protobuf::Resources::Value

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Helper::Protobuf
Defined in:
lib/app_info/protobuf/resources.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::Protobuf

#reference_segments

Constructor Details

#initialize(doc, package) ⇒ Value

Returns a new instance of Value.



163
164
165
166
167
# File 'lib/app_info/protobuf/resources.rb', line 163

def initialize(doc, package)
  @package = package
  @config = doc.config
  @value = parsed_value(doc.value)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



161
162
163
# File 'lib/app_info/protobuf/resources.rb', line 161

def config
  @config
end

#localeObject (readonly)

Returns the value of attribute locale.



161
162
163
# File 'lib/app_info/protobuf/resources.rb', line 161

def locale
  @locale
end

#original_valueObject (readonly)

Returns the value of attribute original_value.



161
162
163
# File 'lib/app_info/protobuf/resources.rb', line 161

def original_value
  @original_value
end

#typeObject (readonly)

Returns the value of attribute type.



161
162
163
# File 'lib/app_info/protobuf/resources.rb', line 161

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



161
162
163
# File 'lib/app_info/protobuf/resources.rb', line 161

def value
  @value
end

Instance Method Details

#inspectObject



179
180
181
# File 'lib/app_info/protobuf/resources.rb', line 179

def inspect
  "<#{self.class.name} value:#{@value} original_value:#{original_value}>"
end

#layout_sizeObject



171
172
173
# File 'lib/app_info/protobuf/resources.rb', line 171

def layout_size
  @config.screen_layout_size
end

#night_mode?Boolean

Returns:

  • (Boolean)


175
176
177
# File 'lib/app_info/protobuf/resources.rb', line 175

def night_mode?
  @config.ui_mode_night == :UI_MODE_NIGHT_NIGHT
end

#to_hObject



183
184
185
# File 'lib/app_info/protobuf/resources.rb', line 183

def to_h
  @config.to_h.merge(value: @original_value.to_h)
end