Class: OoxmlParser::LinearGradient
- Inherits:
-
Object
- Object
- OoxmlParser::LinearGradient
- Defined in:
- lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb
Instance Attribute Summary collapse
-
#angle ⇒ Object
Returns the value of attribute angle.
-
#scaled ⇒ Object
Returns the value of attribute scaled.
Class Method Summary collapse
-
.parse(node) ⇒ LinearGradient
Parse LinearGradient object.
Instance Method Summary collapse
-
#initialize(angle = nil, scaled = nil) ⇒ LinearGradient
constructor
A new instance of LinearGradient.
Constructor Details
#initialize(angle = nil, scaled = nil) ⇒ LinearGradient
Returns a new instance of LinearGradient.
5 6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb', line 5 def initialize(angle = nil, scaled = nil) @angle = angle @scaled = scaled end |
Instance Attribute Details
#angle ⇒ Object
Returns the value of attribute angle.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb', line 3 def angle @angle end |
#scaled ⇒ Object
Returns the value of attribute scaled.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb', line 3 def scaled @scaled end |
Class Method Details
.parse(node) ⇒ LinearGradient
Parse LinearGradient object
13 14 15 16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color/linear_gradient.rb', line 13 def self.parse(node) gradient = LinearGradient.new gradient.angle = node.attribute('ang').value.to_f / 100_000.0 if node.attribute('ang') gradient.scaled = node.attribute('scaled').value.to_i if node.attribute('scaled') gradient end |