Module: Cura::Attributes::HasOffsets
Overview
Adds the ‘offsets` attribute to objects.
Instance Attribute Summary collapse
-
#offsets ⇒ Offsets
readonly
Get the offsets of this object.
Instance Method Summary collapse
-
#border ⇒ Borders
Get the borders of this object.
-
#border=(value) ⇒ Borders
Set the borders of this object.
- #initialize(attributes = {}) ⇒ Object
-
#margin ⇒ Margins
Get the margins of this object.
-
#margin=(value) ⇒ Margins
Set the margins of this object.
-
#padding ⇒ Padding
Get the padding of this object.
-
#padding=(value) ⇒ Padding
Set the padding of this object.
Methods included from HasAttributes
Instance Attribute Details
#offsets ⇒ Offsets (readonly)
Get the offsets of this object.
67 68 69 |
# File 'lib/cura/attributes/has_offsets.rb', line 67 def offsets @offsets end |
Instance Method Details
#border ⇒ Borders
Get the borders of this object.
|
# File 'lib/cura/attributes/has_offsets.rb', line 15
|
#border=(value) ⇒ Borders
Set the borders of this object.
26 |
# File 'lib/cura/attributes/has_offsets.rb', line 26 attribute(:border, type: Borders) { |value, | validate_offset_attribute(value, [:type]) } |
#initialize(attributes = {}) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/cura/attributes/has_offsets.rb', line 54 def initialize(attributes={}) @offsets = Offsets.new(component: self) self.margin = attributes[:margin] self.border = attributes[:border] self.padding = attributes[:padding] super end |
#margin ⇒ Margins
Get the margins of this object.
|
# File 'lib/cura/attributes/has_offsets.rb', line 28
|
#margin=(value) ⇒ Margins
Set the margins of this object.
39 |
# File 'lib/cura/attributes/has_offsets.rb', line 39 attribute(:margin, type: Margins) { |value, | validate_offset_attribute(value, [:type]) } |
#padding ⇒ Padding
Get the padding of this object.
|
# File 'lib/cura/attributes/has_offsets.rb', line 41
|
#padding=(value) ⇒ Padding
Set the padding of this object.
52 |
# File 'lib/cura/attributes/has_offsets.rb', line 52 attribute(:padding, type: Padding) { |value, | validate_offset_attribute(value, [:type]) } |