Class: AsposeSlidesCloud::QuadraticBezierToPathSegment

Inherits:
PathSegment show all
Defined in:
lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb

Overview

Quadratic Bezier curve segment of the geometry path

Instance Attribute Summary collapse

Attributes inherited from PathSegment

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ QuadraticBezierToPathSegment

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 62

def initialize(attributes = {})
  super

  if attributes.has_key?(:'X1')
    self.x1 = attributes[:'X1']
  end

  if attributes.has_key?(:'Y1')
    self.y1 = attributes[:'Y1']
  end

  if attributes.has_key?(:'X2')
    self.x2 = attributes[:'X2']
  end

  if attributes.has_key?(:'Y2')
    self.y2 = attributes[:'Y2']
  end
  self.type = 'QuadBezierTo'
end

Instance Attribute Details

#x1Object

X coordinate of direction point



29
30
31
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 29

def x1
  @x1
end

#x2Object

X coordinate of end point



35
36
37
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 35

def x2
  @x2
end

#y1Object

Y coordinate of direction point



32
33
34
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 32

def y1
  @y1
end

#y2Object

Y coordinate of end point



38
39
40
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 38

def y2
  @y2
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



41
42
43
44
45
46
47
48
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 41

def self.attribute_map
  super.merge({
    :'x1' => :'X1',
    :'y1' => :'Y1',
    :'x2' => :'X2',
    :'y2' => :'Y2',
  })
end

.swagger_typesObject

Attribute type mapping.



51
52
53
54
55
56
57
58
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 51

def self.swagger_types
  super.merge({
    :'x1' => :'Float',
    :'y1' => :'Float',
    :'x2' => :'Float',
    :'y2' => :'Float',
  })
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



119
120
121
122
123
124
125
126
127
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 119

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      x1 == o.x1 &&
      y1 == o.y1 &&
      x2 == o.x2 &&
      y2 == o.y2
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


131
132
133
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 131

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



137
138
139
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 137

def hash
  [type, x1, y1, x2, y2].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 85

def list_invalid_properties
  invalid_properties = super
  if @x1.nil?
    invalid_properties.push('invalid value for "x1", x1 cannot be nil.')
  end

  if @y1.nil?
    invalid_properties.push('invalid value for "y1", y1 cannot be nil.')
  end

  if @x2.nil?
    invalid_properties.push('invalid value for "x2", x2 cannot be nil.')
  end

  if @y2.nil?
    invalid_properties.push('invalid value for "y2", y2 cannot be nil.')
  end

  invalid_properties
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



108
109
110
111
112
113
114
115
# File 'lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb', line 108

def valid?
  return false if !super
  return false if @x1.nil?
  return false if @y1.nil?
  return false if @x2.nil?
  return false if @y2.nil?
  true
end