Class: TFClient::Models::Brightness
- Defined in:
- lib/textflight-client/models/nav.rb
Instance Attribute Summary collapse
-
#percent ⇒ Object
readonly
Returns the value of attribute percent.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Model
#label, #translation, #values_hash
Instance Method Summary collapse
-
#initialize(line:) ⇒ Brightness
constructor
A new instance of Brightness.
- #to_s ⇒ Object
Constructor Details
#initialize(line:) ⇒ Brightness
Returns a new instance of Brightness.
131 132 133 134 135 |
# File 'lib/textflight-client/models/nav.rb', line 131 def initialize(line:) super(line: line) @value = @values_hash[:brightness].to_i @percent = ((@value/255.0) * 100).round end |
Instance Attribute Details
#percent ⇒ Object (readonly)
Returns the value of attribute percent.
129 130 131 |
# File 'lib/textflight-client/models/nav.rb', line 129 def percent @percent end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
129 130 131 |
# File 'lib/textflight-client/models/nav.rb', line 129 def value @value end |
Instance Method Details
#to_s ⇒ Object
137 138 139 |
# File 'lib/textflight-client/models/nav.rb', line 137 def to_s %Q[#{@translation}: #{@value} => #{@percent}%] end |