Class: Archimate::Svg::Entity::MotivationEntity
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- Archimate::Svg::Entity::MotivationEntity
- Defined in:
- lib/archimate/svg/entity/motivation_entity.rb
Direct Known Subclasses
Assessment, Constraint, Driver, Goal, Outcome, Principle, Requirement, Stakeholder
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) ⇒ MotivationEntity
constructor
A new instance of MotivationEntity.
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) ⇒ MotivationEntity
Returns a new instance of MotivationEntity.
7 8 9 10 11 12 13 14 15 |
# File 'lib/archimate/svg/entity/motivation_entity.rb', line 7 def initialize(child, bounds_offset) super @badge_bounds = DataModel::Bounds.new( x: child.bounds.right - 25, y: child.bounds.top + 5, width: 20, height: 20 ) end |
Instance Method Details
#entity_shape(xml, bounds) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/archimate/svg/entity/motivation_entity.rb', line 17 def entity_shape(xml, bounds) margin = 10 width = bounds.width - margin * 2 height = bounds.height - margin * 2 xml.path( d: [ ["M", bounds.left + margin, bounds.top], ["h", width], ["l", margin, margin], ["v", height], ["l", -margin, margin], ["h", -width], ["l", -margin, -margin], ["v", -height], "z" ].flatten.join(" "), class: background_class, style: shape_style ) end |