Class: MapKit::DataTypes::MapSize
- Inherits:
-
Object
- Object
- MapKit::DataTypes::MapSize
- Defined in:
- lib/map-kit-wrapper/map_kit_data_types.rb
Overview
Wrapper for MKMapSize
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(*args) ⇒ MapSize
constructor
MapSize.new(10,12) MapSize.new([10,12]) MapSize.new(=> 10, :height => 12) MapSize.new(MKMapSize) MapSize.new(MapSize).
- #sdk ⇒ Object
- #to_a ⇒ Object
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ MapSize
MapSize.new(10,12) MapSize.new([10,12]) MapSize.new(=> 10, :height => 12) MapSize.new(MKMapSize) MapSize.new(MapSize)
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 169 def initialize(*args) args.flatten! self.width, self.height = case args.size when 1 arg = args[0] case arg when Hash [arg[:width], arg[:height]] else [arg.width, arg.height] end when 2 [args[0], args[1]] end end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
162 163 164 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 162 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
162 163 164 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 162 def width @width end |
Instance Method Details
#sdk ⇒ Object
186 187 188 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 186 def sdk MKMapSizeMake(@width, @height) end |
#to_a ⇒ Object
198 199 200 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 198 def to_a [@width, @height] end |
#to_h ⇒ Object
202 203 204 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 202 def to_h {:width => @width, :height => @height} end |
#to_s ⇒ Object
206 207 208 |
# File 'lib/map-kit-wrapper/map_kit_data_types.rb', line 206 def to_s to_h.to_s end |