Class: Archimate::Svg::Entity::Contract
- Inherits:
-
DataEntity
- Object
- BaseEntity
- DataEntity
- Archimate::Svg::Entity::Contract
- Defined in:
- lib/archimate/svg/entity/contract.rb
Instance Attribute Summary
Attributes inherited from BaseEntity
#background_class, #badge, #badge_bounds, #bounds_offset, #child, #entity, #text_bounds
Instance Method Summary collapse
- #entity_shape(xml, bounds) ⇒ Object
-
#initialize(child, bounds_offset) ⇒ Contract
constructor
A new instance of Contract.
Methods inherited from DataEntity
Methods inherited from BaseEntity
#entity_badge, #entity_label, #group_attrs, #optional_link, #shape_style, #text_lines, #text_style, #to_svg
Constructor Details
#initialize(child, bounds_offset) ⇒ Contract
Returns a new instance of Contract.
7 8 9 |
# File 'lib/archimate/svg/entity/contract.rb', line 7 def initialize(child, bounds_offset) super end |
Instance Method Details
#entity_shape(xml, bounds) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/archimate/svg/entity/contract.rb', line 11 def entity_shape(xml, bounds) calc_text_bounds(bounds) xml.g(class: background_class) do xml.rect(x: bounds.left, y: bounds.top, width: bounds.width, height: bounds.height, class: background_class, style: shape_style) xml.rect(x: bounds.left, y: bounds.top, width: bounds.width, height: @margin, class: "archimate-decoration") xml.rect(x: bounds.left, y: bounds.top + bounds.height - @margin, width: bounds.width, height: @margin, class: "archimate-decoration") end end |