Class: Goldendocx::Images::Properties::ShapeProperty
- Inherits:
-
Object
- Object
- Goldendocx::Images::Properties::ShapeProperty
- Includes:
- Element
- Defined in:
- lib/goldendocx/images/properties/shape_property.rb
Constant Summary collapse
- DEFAULT_SHAPE_WIDTH =
1 : 0.618
Goldendocx::Units::EMU_PER_CENTIMETER * 15
- DEFAULT_SHAPE_HEIGHT =
Goldendocx::Units::EMU_PER_CENTIMETER * 9.27
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
Methods included from Element
#build_element, #initialize, #namespace, #tag, #tag_name, #to_element, #to_xml
Methods included from HasChildren
#children, #read_child, #read_children
Methods included from HasAttributes
#assign_attributes, #attributes, #read_attributes
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
13 14 15 |
# File 'lib/goldendocx/images/properties/shape_property.rb', line 13 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
13 14 15 |
# File 'lib/goldendocx/images/properties/shape_property.rb', line 13 def width @width end |
Instance Method Details
#formatted_style ⇒ Object
22 23 24 25 26 |
# File 'lib/goldendocx/images/properties/shape_property.rb', line 22 def formatted_style height = ((self.height || DEFAULT_SHAPE_HEIGHT) / Goldendocx::Units::EMU_PER_CENTIMETER).round(2) width = ((self.width || DEFAULT_SHAPE_WIDTH) / Goldendocx::Units::EMU_PER_CENTIMETER).round(2) "height:#{height}cm;width:#{width}cm" end |