Class: AppInfo::Protobuf::Resources::Value
- Inherits:
-
Object
- Object
- AppInfo::Protobuf::Resources::Value
- Extended by:
- Forwardable
- Includes:
- Helper::Protobuf
- Defined in:
- lib/app_info/protobuf/resources.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#original_value ⇒ Object
readonly
Returns the value of attribute original_value.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(doc, package) ⇒ Value
constructor
A new instance of Value.
- #inspect ⇒ Object
- #layout_size ⇒ Object
- #night_mode? ⇒ Boolean
- #to_h ⇒ Object
Methods included from Helper::Protobuf
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
#config ⇒ Object (readonly)
Returns the value of attribute config.
161 162 163 |
# File 'lib/app_info/protobuf/resources.rb', line 161 def config @config end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
161 162 163 |
# File 'lib/app_info/protobuf/resources.rb', line 161 def locale @locale end |
#original_value ⇒ Object (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 |
#type ⇒ Object (readonly)
Returns the value of attribute type.
161 162 163 |
# File 'lib/app_info/protobuf/resources.rb', line 161 def type @type end |
#value ⇒ Object (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
#inspect ⇒ Object
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_size ⇒ Object
171 172 173 |
# File 'lib/app_info/protobuf/resources.rb', line 171 def layout_size @config.screen_layout_size end |
#night_mode? ⇒ 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_h ⇒ Object
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 |