Class: Hokusai::Outline
- Inherits:
-
Struct
- Object
- Struct
- Hokusai::Outline
- Defined in:
- ui/src/hokusai/types.rb
Instance Attribute Summary collapse
-
#bottom ⇒ Object
Returns the value of attribute bottom.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#top ⇒ Object
Returns the value of attribute top.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#bottom ⇒ Object
Returns the value of attribute bottom
50 51 52 |
# File 'ui/src/hokusai/types.rb', line 50 def bottom @bottom end |
#left ⇒ Object
Returns the value of attribute left
50 51 52 |
# File 'ui/src/hokusai/types.rb', line 50 def left @left end |
#right ⇒ Object
Returns the value of attribute right
50 51 52 |
# File 'ui/src/hokusai/types.rb', line 50 def right @right end |
#top ⇒ Object
Returns the value of attribute top
50 51 52 |
# File 'ui/src/hokusai/types.rb', line 50 def top @top end |
Class Method Details
.convert(value) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'ui/src/hokusai/types.rb', line 59 def self.convert(value) case value when String if value =~ /,/ convert(value.split(",").map(&:to_f)) else convert(value.to_f) end when Float new(value, value, value, value) when Array new(value[0] || 0.0, value[1] || 0.0, value[2] || 0.0, value[3] || 0.0) when Outline value end end |
.default ⇒ Object
51 52 53 |
# File 'ui/src/hokusai/types.rb', line 51 def self.default new(0.0, 0.0, 0.0, 0.0) end |
Instance Method Details
#hash ⇒ Object
55 56 57 |
# File 'ui/src/hokusai/types.rb', line 55 def hash [self.class, top, right, bottom, left].hash end |
#present? ⇒ Boolean
76 77 78 |
# File 'ui/src/hokusai/types.rb', line 76 def present? top > 0.0 || right > 0.0 || bottom > 0.0 || left > 0.0 end |
#uniform? ⇒ Boolean
80 81 82 |
# File 'ui/src/hokusai/types.rb', line 80 def uniform? top == right && top == bottom && top == left end |