{"id":34127,"date":"2025-11-11T14:40:52","date_gmt":"2025-11-11T11:40:52","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/?p=34127"},"modified":"2025-11-11T14:40:52","modified_gmt":"2025-11-11T11:40:52","slug":"rubyde-veri-turleri-nasil-donusturulur","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/","title":{"rendered":"Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?"},"content":{"rendered":"<p><body><\/p>\n<h2>Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?<\/h2>\n<p>Ruby, dinamik ve esnek bir programlama dilidir. Bu esneklik, geli\u015ftiricilere veri t\u00fcrleri \u00fczerinde g\u00fc\u00e7l\u00fc kontrol sa\u011flarken, ayn\u0131 zamanda veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme (type conversion veya type casting) ihtiyac\u0131n\u0131 da beraberinde getirir. Farkl\u0131 veri t\u00fcrleri aras\u0131nda sorunsuz ge\u00e7i\u015f yapabilmek, Ruby uygulamalar\u0131n\u0131n temel bir yetene\u011fidir ve \u00e7e\u015fitli senaryolarda kritik \u00f6neme sahiptir. Bu makale, Ruby&#8217;deki temel ve ileri d\u00fczey veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme y\u00f6ntemlerini, \u00f6rneklerle a\u00e7\u0131klayarak, bu konudaki bilginizi derinle\u015ftirmeyi ama\u00e7lamaktad\u0131r.<\/p>\n<h3>Giri\u015f: Veri T\u00fcrleri ve D\u00f6n\u00fc\u015f\u00fcm\u00fcn \u00d6nemi<\/h3>\n<p>Ruby&#8217;de her de\u011fer bir nesnedir ve bu nesneler belirli veri t\u00fcrlerine aittir. Temel veri t\u00fcrleri aras\u0131nda say\u0131lar (Integer, Float), dizeler (String), diziler (Array), hash&#8217;ler (Hash), semboller (Symbol), boolean de\u011ferler (true, false) ve <code>nil<\/code> bulunur. Bir\u00e7ok programlama dilinde oldu\u011fu gibi, Ruby&#8217;de de farkl\u0131 veri t\u00fcrlerini bir arada kullanmak veya bir t\u00fcrdeki veriyi ba\u015fka bir t\u00fcre d\u00f6n\u00fc\u015ft\u00fcrmek yayg\u0131n bir gereksinimdir.<\/p>\n<p>Veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme ihtiyac\u0131 bir\u00e7ok farkl\u0131 durumda ortaya \u00e7\u0131kar:<br \/>\n*   <strong>Kullan\u0131c\u0131 Giri\u015fi:<\/strong> Web formlar\u0131ndan veya konsoldan al\u0131nan t\u00fcm veriler genellikle dize (String) olarak gelir. Bu verileri matematiksel i\u015flemler i\u00e7in say\u0131ya, mant\u0131ksal kontroller i\u00e7in boolean&#8217;a veya yap\u0131land\u0131r\u0131lm\u0131\u015f veri i\u00e7in dizi\/hash&#8217;e d\u00f6n\u00fc\u015ft\u00fcrmek gerekir.<br \/>\n*   <strong>Veritaban\u0131 ve API Entegrasyonlar\u0131:<\/strong> D\u0131\u015f sistemlerden al\u0131nan veriler, uygulaman\u0131z\u0131n bekledi\u011fi format ve t\u00fcrde olmayabilir. \u00d6rne\u011fin, bir API&#8217;den gelen say\u0131sal de\u011ferler dize olarak temsil edilebilir.<br \/>\n*   <strong>Veri Manip\u00fclasyonu:<\/strong> Bir dize i\u00e7indeki say\u0131lar\u0131 matematiksel olarak i\u015flemek, bir dizi i\u00e7indeki \u00f6\u011feleri bir dizeye birle\u015ftirmek veya bir hash&#8217;i anahtar\/de\u011fer \u00e7iftleri dizisine d\u00f6n\u00fc\u015ft\u00fcrmek gibi i\u015flemler i\u00e7in d\u00f6n\u00fc\u015f\u00fcm \u015fartt\u0131r.<br \/>\n*   <strong>Mant\u0131ksal Kontroller:<\/strong> <code>if<\/code> veya <code>while<\/code> gibi ko\u015fullu ifadelerde, belirli bir de\u011ferin varl\u0131\u011f\u0131n\u0131 veya &#8220;do\u011frulu\u011funu&#8221; kontrol etmek i\u00e7in bazen dolayl\u0131 t\u00fcr d\u00f6n\u00fc\u015f\u00fcmlerine ihtiya\u00e7 duyulur.<\/p>\n<p>Ruby&#8217;nin dinamik yap\u0131s\u0131, \u00e7o\u011fu zaman t\u00fcrleri otomatik olarak zorlasa da (\u00f6rne\u011fin, bir Integer ile bir Float&#8217;\u0131 toplad\u0131\u011f\u0131n\u0131zda sonu\u00e7 Float olur), a\u00e7\u0131k (explicit) veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme y\u00f6ntemleri, kodunuzun daha okunabilir, \u00f6ng\u00f6r\u00fclebilir ve hatas\u0131z olmas\u0131n\u0131 sa\u011flar.<\/p>\n<h3>Temel Veri T\u00fcrleri ve D\u00f6n\u00fc\u015f\u00fcm Y\u00f6ntemleri<\/h3>\n<p>Ruby&#8217;deki hemen hemen her nesne, di\u011fer t\u00fcrlere d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in kullan\u0131labilecek \u00f6zel metotlara sahiptir. Bu metotlar genellikle <code>to_<\/code> \u00f6nekiyle ba\u015flar (\u00f6rne\u011fin, <code>to_s<\/code>, <code>to_i<\/code>, <code>to_f<\/code>).<\/p>\n<h4>Dizeden (String) Di\u011fer T\u00fcrlere D\u00f6n\u00fc\u015f\u00fcm<\/h4>\n<p>Dizeler, Ruby&#8217;de en s\u0131k kar\u015f\u0131la\u015f\u0131lan veri t\u00fcrlerinden biridir ve genellikle di\u011fer t\u00fcrlere d\u00f6n\u00fc\u015ft\u00fcr\u00fclmesi gereken ilk t\u00fcrd\u00fcr.<\/p>\n<h5><code>to_i<\/code> (Tam Say\u0131ya D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Bir dizeyi tam say\u0131ya d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in <code>to_i<\/code> metodu kullan\u0131l\u0131r. Bu metot, dizenin ba\u015f\u0131ndan itibaren ge\u00e7erli say\u0131sal karakterleri ayr\u0131\u015ft\u0131r\u0131r ve ilk ge\u00e7ersiz karakterde durur. E\u011fer dize say\u0131sal bir karakterle ba\u015flam\u0131yorsa, <code>0<\/code> d\u00f6ner.<\/p>\n<pre><code class=\"language-ruby\">\"123\".to_i         # => 123\n\"123a45\".to_i      # => 123\n\"a123\".to_i        # => 0\n\"\".to_i            # => 0\n\"  456 \".to_i      # => 456 (ba\u015f\u0131ndaki ve sonundaki bo\u015fluklar\u0131 yoksayar)\n\"123.45\".to_i      # => 123 (ondal\u0131kl\u0131 k\u0131sm\u0131 keser)\n\"007\".to_i         # => 7<\/code><\/pre>\n<p><code>to_i<\/code> metodu ayr\u0131ca say\u0131 sistemini (taban) belirten bir arg\u00fcman alabilir:<\/p>\n<pre><code class=\"language-ruby\">\"101\".to_i(2)      # => 5 (ikili sistemden onlu sisteme)\n\"FF\".to_i(16)      # => 255 (onalt\u0131l\u0131k sistemden onlu sisteme)\n\"10\".to_i(8)       # => 8 (sekizlik sistemden onlu sisteme)<\/code><\/pre>\n<h5><code>to_f<\/code> (Ondal\u0131kl\u0131 Say\u0131ya D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Bir dizeyi ondal\u0131kl\u0131 say\u0131ya (Float) d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in <code>to_f<\/code> metodu kullan\u0131l\u0131r. Bu metot da <code>to_i<\/code> gibi, dizenin ba\u015f\u0131ndan itibaren ge\u00e7erli say\u0131sal ve ondal\u0131k nokta karakterlerini ayr\u0131\u015ft\u0131r\u0131r.<\/p>\n<pre><code class=\"language-ruby\">\"123.45\".to_f      # => 123.45\n\"123\".to_f         # => 123.0\n\"45.67a8\".to_f     # => 45.67\n\"a123.45\".to_f     # => 0.0\n\"\".to_f            # => 0.0\n\"  78.90 \".to_f    # => 78.9<\/code><\/pre>\n<h5><code>to_sym<\/code> (Sembole D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Dizeleri sembollere d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in <code>to_sym<\/code> metodu kullan\u0131l\u0131r. Semboller, Ruby&#8217;de de\u011fi\u015fmez (immutable) ve tekil (unique) tan\u0131mlay\u0131c\u0131lard\u0131r, \u00f6zellikle hash anahtarlar\u0131 veya metot isimleri i\u00e7in s\u0131k\u00e7a kullan\u0131l\u0131rlar.<\/p>\n<pre><code class=\"language-ruby\">\"merhaba\".to_sym   # => :merhaba\n\"bir_sembol\".to_sym # => :bir_sembol\n\"deneme\".intern    # => :deneme (intern, to_sym ile ayn\u0131 i\u015flevi g\u00f6r\u00fcr)<\/code><\/pre>\n<h5><code>to_a<\/code> (Diziye D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Bir dizeyi do\u011frudan bir diziye d\u00f6n\u00fc\u015ft\u00fcrmek genellikle dizedeki karakterleri ayr\u0131 ayr\u0131 \u00f6\u011feler olarak almak anlam\u0131na gelir. Bunun i\u00e7in <code>chars<\/code> veya <code>split('')<\/code> metotlar\u0131 daha yayg\u0131n kullan\u0131l\u0131r. <code>to_a<\/code> metodu, dize nesnesi \u00fczerinde do\u011frudan anlaml\u0131 bir d\u00f6n\u00fc\u015f\u00fcm sa\u011flamaz, ancak baz\u0131 koleksiyon metotlar\u0131 ile birlikte kullan\u0131labilir.<\/p>\n<pre><code class=\"language-ruby\">\"hello\".chars      # => [\"h\", \"e\", \"l\", \"l\", \"o\"]\n\"hello\".split('')  # => [\"h\", \"e\", \"l\", \"l\", \"o\"]\n\"elma,armut,kiraz\".split(',') # => [\"elma\", \"armut\", \"kiraz\"]<\/code><\/pre>\n<h4>Say\u0131sal T\u00fcrlerden Di\u011fer T\u00fcrlere D\u00f6n\u00fc\u015f\u00fcm<\/h4>\n<p>Integer ve Float gibi say\u0131sal t\u00fcrler de di\u011fer t\u00fcrlere d\u00f6n\u00fc\u015ft\u00fcr\u00fclebilir.<\/p>\n<h5>Integer (Tam Say\u0131) D\u00f6n\u00fc\u015f\u00fcmleri<\/h5>\n<p>*   <strong><code>to_f<\/code> (Ondal\u0131kl\u0131 Say\u0131ya D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong> Bir tam say\u0131y\u0131 ondal\u0131kl\u0131 say\u0131ya d\u00f6n\u00fc\u015ft\u00fcr\u00fcr.<\/p>\n<pre><code class=\"language-ruby\">10.to_f            # => 10.0<\/code><\/pre>\n<p>*   <strong><code>to_s<\/code> (Dizeye D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong> Bir tam say\u0131y\u0131 dizeye d\u00f6n\u00fc\u015ft\u00fcr\u00fcr.<\/p>\n<pre><code class=\"language-ruby\">123.to_s           # => \"123\"<\/code><\/pre>\n<p>*   <strong><code>chr<\/code> (Karaktere D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong> Tam say\u0131n\u0131n ASCII veya Unicode kar\u015f\u0131l\u0131\u011f\u0131 olan karakteri d\u00f6nd\u00fcr\u00fcr.<\/p>\n<pre><code class=\"language-ruby\">65.chr             # => \"A\"\n    97.chr             # => \"a\"\n    246.chr(Encoding::UTF_8) # => \"\u00f6\"<\/code><\/pre>\n<h5>Float (Ondal\u0131kl\u0131 Say\u0131) D\u00f6n\u00fc\u015f\u00fcmleri<\/h5>\n<p>*   <strong><code>to_i<\/code> (Tam Say\u0131ya D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong> Bir ondal\u0131kl\u0131 say\u0131y\u0131 tam say\u0131ya d\u00f6n\u00fc\u015ft\u00fcr\u00fcr. Bu i\u015flemde ondal\u0131kl\u0131 k\u0131s\u0131m kesilir (truncate).<\/p>\n<pre><code class=\"language-ruby\">123.45.to_i        # => 123\n    -123.45.to_i       # => -123<\/code><\/pre>\n<p>*   <strong>Yuvarlama Metotlar\u0131:<\/strong> <code>to_i<\/code> her zaman a\u015fa\u011f\u0131 yuvarlamaz; sadece ondal\u0131k k\u0131sm\u0131 atar. Farkl\u0131 yuvarlama davran\u0131\u015flar\u0131 i\u00e7in <code>round<\/code>, <code>ceil<\/code>, <code>floor<\/code> ve <code>truncate<\/code> metotlar\u0131 kullan\u0131l\u0131r.<\/p>\n<pre><code class=\"language-ruby\">3.14.round         # => 3\n    3.7.round          # => 4\n    3.14.ceil          # => 4 (yukar\u0131 yuvarlar)\n    3.7.floor          # => 3 (a\u015fa\u011f\u0131 yuvarlar)\n    3.14.truncate      # => 3 (ondal\u0131k k\u0131sm\u0131 keser, to_i ile ayn\u0131 davran\u0131\u015f)<\/code><\/pre>\n<p>*   <strong><code>to_s<\/code> (Dizeye D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong> Bir ondal\u0131kl\u0131 say\u0131y\u0131 dizeye d\u00f6n\u00fc\u015ft\u00fcr\u00fcr.<\/p>\n<pre><code class=\"language-ruby\">123.45.to_s        # => \"123.45\"<\/code><\/pre>\n<h4>Diziden (Array) Di\u011fer T\u00fcrlere D\u00f6n\u00fc\u015f\u00fcm<\/h4>\n<p>Diziler, s\u0131ral\u0131 veri koleksiyonlar\u0131n\u0131 temsil eder ve di\u011fer t\u00fcrlere d\u00f6n\u00fc\u015ft\u00fcrme konusunda esneklik sunar.<\/p>\n<h5><code>to_s<\/code> (Dizeye D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Bir diziyi dizeye d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in <code>to_s<\/code> metodu kullan\u0131l\u0131r. Bu metot, genellikle dizinin <code>inspect<\/code> \u00e7\u0131kt\u0131s\u0131n\u0131 d\u00f6nd\u00fcr\u00fcr. Daha kontroll\u00fc bir dize elde etmek i\u00e7in <code>join<\/code> metodu tercih edilir.<\/p>\n<pre><code class=\"language-ruby\">[1, 2, 3].to_s     # => \"[1, 2, 3]\"\n[\"elma\", \"armut\"].to_s # => \"[\\\"elma\\\", \\\"armut\\\"]\"\n\n[1, 2, 3].join     # => \"123\" (varsay\u0131lan olarak \u00f6\u011feleri birle\u015ftirir)\n[1, 2, 3].join('-') # => \"1-2-3\" (belirtilen ay\u0131r\u0131c\u0131 ile birle\u015ftirir)\n[\"elma\", \"armut\"].join(', ') # => \"elma, armut\"<\/code><\/pre>\n<h5><code>to_h<\/code> (Hash&#8217;e D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>\u0130ki boyutlu bir dizi (anahtar-de\u011fer \u00e7iftlerinden olu\u015fan dizilerden olu\u015fan bir dizi) bir hash&#8217;e d\u00f6n\u00fc\u015ft\u00fcr\u00fclebilir.<\/p>\n<pre><code class=\"language-ruby\">[[\"a\", 1], [\"b\", 2]].to_h # => {\"a\"=>1, \"b\"=>2}\n[[:a, 1], [:b, 2]].to_h   # => {:a=>1, :b=>2}<\/code><\/pre>\n<p>E\u011fer dizi, anahtar-de\u011fer \u00e7iftleri i\u00e7ermiyorsa veya tek boyutluysa, <code>to_h<\/code> metodu <code>ArgumentError<\/code> hatas\u0131 verecektir.<\/p>\n<pre><code class=\"language-ruby\">[1, 2, 3].to_h # ArgumentError: wrong number of arguments (given 1, expected 0)<\/code><\/pre>\n<h5><code>flatten<\/code> (\u0130\u00e7 \u0130\u00e7e Dizileri D\u00fczle\u015ftirme)<\/h5>\n<p>Bir dizi i\u00e7indeki i\u00e7 i\u00e7e dizileri tek bir d\u00fcz diziye d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in <code>flatten<\/code> metodu kullan\u0131l\u0131r.<\/p>\n<pre><code class=\"language-ruby\">[1, [2, 3], [4, [5, 6]]].flatten # => [1, 2, 3, 4, 5, 6]<\/code><\/pre>\n<h4>Hash&#8217;ten (Hash) Di\u011fer T\u00fcrlere D\u00f6n\u00fc\u015f\u00fcm<\/h4>\n<p>Hash&#8217;ler, anahtar-de\u011fer \u00e7iftlerini saklayan koleksiyonlard\u0131r ve dizilere veya dizelere d\u00f6n\u00fc\u015ft\u00fcr\u00fclebilirler.<\/p>\n<h5><code>to_a<\/code> (Diziye D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Bir hash&#8217;i, anahtar-de\u011fer \u00e7iftlerinden olu\u015fan iki boyutlu bir diziye d\u00f6n\u00fc\u015ft\u00fcr\u00fcr. Her anahtar-de\u011fer \u00e7ifti, iki \u00f6\u011feli bir i\u00e7 dizi (array) olarak temsil edilir.<\/p>\n<pre><code class=\"language-ruby\">{:a => 1, :b => 2}.to_a # => [[:a, 1], [:b, 2]]\n{\"name\" => \"Alice\", \"age\" => 30}.to_a # => [[\"name\", \"Alice\"], [\"age\", 30]]<\/code><\/pre>\n<h5><code>to_s<\/code> (Dizeye D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Bir hash&#8217;i dizeye d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in <code>to_s<\/code> metodu, hash&#8217;in <code>inspect<\/code> \u00e7\u0131kt\u0131s\u0131n\u0131 d\u00f6nd\u00fcr\u00fcr.<\/p>\n<pre><code class=\"language-ruby\">{:a => 1, :b => 2}.to_s # => \"{:a=>1, :b=>2}\"<\/code><\/pre>\n<h5><code>keys<\/code> ve <code>values<\/code> (Anahtarlar\u0131 veya De\u011ferleri Diziye D\u00f6n\u00fc\u015ft\u00fcrme)<\/h5>\n<p>Hash&#8217;in t\u00fcm anahtarlar\u0131n\u0131 veya t\u00fcm de\u011ferlerini ayr\u0131 bir dizi olarak almak i\u00e7in <code>keys<\/code> ve <code>values<\/code> metotlar\u0131 kullan\u0131l\u0131r.<\/p>\n<pre><code class=\"language-ruby\">my_hash = {name: \"Bob\", age: 25, city: \"New York\"}\nmy_hash.keys   # => [:name, :age, :city]\nmy_hash.values # => [\"Bob\", 25, \"New York\"]<\/code><\/pre>\n<h4>Boolean ve Nil D\u00f6n\u00fc\u015f\u00fcmleri<\/h4>\n<p><code>true<\/code>, <code>false<\/code> ve <code>nil<\/code> \u00f6zel nesnelerdir ve di\u011fer t\u00fcrlere d\u00f6n\u00fc\u015ft\u00fcr\u00fclebilirler. Ruby&#8217;de <code>false<\/code> ve <code>nil<\/code> d\u0131\u015f\u0131ndaki t\u00fcm de\u011ferler <code>true<\/code> olarak kabul edilir (truthy).<\/p>\n<p>*   <strong><code>to_s<\/code> (Dizeye D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong><\/p>\n<pre><code class=\"language-ruby\">true.to_s          # => \"true\"\n    false.to_s         # => \"false\"\n    nil.to_s           # => \"\" (bo\u015f dize)<\/code><\/pre>\n<p>*   <strong><code>to_i<\/code> (Tam Say\u0131ya D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong><\/p>\n<pre><code class=\"language-ruby\">true.to_i          # => 1\n    false.to_i         # => 0\n    nil.to_i           # => 0<\/code><\/pre>\n<h4>Sembollerden (Symbol) Di\u011fer T\u00fcrlere D\u00f6n\u00fc\u015f\u00fcm<\/h4>\n<p>Semboller, \u00f6zellikle dizeye d\u00f6n\u00fc\u015ft\u00fcr\u00fclmeleri gerekti\u011finde kullan\u0131l\u0131r.<\/p>\n<p>*   <strong><code>to_s<\/code> (Dizeye D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong><\/p>\n<pre><code class=\"language-ruby\">:merhaba.to_s      # => \"merhaba\"\n    :bir_sembol.to_s   # => \"bir_sembol\"<\/code><\/pre>\n<p>*   <strong><code>to_sym<\/code> (Sembole D\u00f6n\u00fc\u015ft\u00fcrme):<\/strong> Bir sembol zaten bir sembol oldu\u011fu i\u00e7in bu metodun do\u011frudan bir etkisi yoktur, ancak polimorfik kod yazarken faydal\u0131 olabilir.<\/p>\n<pre><code class=\"language-ruby\">:merhaba.to_sym    # => :merhaba<\/code><\/pre>\n<h3>\u00d6zel D\u00f6n\u00fc\u015f\u00fcm Senaryolar\u0131 ve \u0130pu\u00e7lar\u0131<\/h3>\n<p>Ruby, temel <code>to_<\/code> metotlar\u0131n\u0131n yan\u0131 s\u0131ra, daha spesifik veya kontroll\u00fc d\u00f6n\u00fc\u015f\u00fcmler i\u00e7in \u00e7e\u015fitli ba\u015fka ara\u00e7lar da sunar.<\/p>\n<h4><code>Kernel<\/code> Mod\u00fcl\u00fc Metotlar\u0131: <code>Integer()<\/code>, <code>Float()<\/code>, <code>String()<\/code>, <code>Array()<\/code>, <code>Hash()<\/code><\/h4>\n<p><code>Kernel<\/code> mod\u00fcl\u00fcnde bulunan bu metotlar, <code>to_<\/code> metotlar\u0131na benzer i\u015flevler sunar ancak \u00f6nemli bir farkla: ge\u00e7ersiz giri\u015f durumunda hata f\u0131rlat\u0131rlar (<code>ArgumentError<\/code>). Bu, \u00f6zellikle d\u0131\u015f kaynaklardan gelen verileri i\u015flerken ve hata y\u00f6netimini zorunlu k\u0131lmak istedi\u011finizde kullan\u0131\u015fl\u0131d\u0131r.<\/p>\n<pre><code class=\"language-ruby\"># String'den Integer'a\nInteger(\"123\")     # => 123\nInteger(\"123.45\")  # => 123\nInteger(\"123a\")    # ArgumentError: invalid value for Integer(): \"123a\" (to_i ise 123 d\u00f6nerdi)\nInteger(nil)       # TypeError: no implicit conversion of nil into String (to_i ise 0 d\u00f6nerdi)\n\n<h2>String'den Float'a<\/h2>\nFloat(\"123.45\")    # => 123.45\nFloat(\"123\")       # => 123.0\nFloat(\"123a\")      # ArgumentError: invalid value for Float(): \"123a\" (to_f ise 123.0 d\u00f6nerdi)\n\n<h2>Di\u011fer t\u00fcrlerden String'e<\/h2>\nString(123)        # => \"123\"\nString([1, 2])     # => \"[1, 2]\"\n\n<h2>Di\u011fer t\u00fcrlerden Array'e<\/h2>\nArray(1)           # => [1]\nArray(\"hello\")     # => [\"hello\"]\nArray({a: 1, b: 2}) # => [[:a, 1], [:b, 2]]\n\n<h2>Di\u011fer t\u00fcrlerden Hash'e<\/h2>\nHash([[:a, 1], [:b, 2]]) # => {:a=>1, :b=>2}\nHash(nil)          # TypeError: no implicit conversion of nil into Hash<\/code><\/pre>\n<p><code>Kernel<\/code> metotlar\u0131, \u00f6zellikle kullan\u0131c\u0131dan veya d\u0131\u015f sistemlerden gelen verilerin tipini kesin olarak do\u011frulamak istedi\u011finizde <code>to_<\/code> metotlar\u0131na g\u00f6re daha g\u00fcvenli bir se\u00e7enektir.<\/p>\n<h4>Tarih ve Saat D\u00f6n\u00fc\u015f\u00fcmleri<\/h4>\n<p>Tarih ve saat nesneleri (Date, Time, DateTime), dizelerle s\u0131k\u00e7a d\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr. Ruby&#8217;nin standart k\u00fct\u00fcphanesindeki <code>Date<\/code>, <code>Time<\/code> ve <code>DateTime<\/code> s\u0131n\u0131flar\u0131 bu d\u00f6n\u00fc\u015f\u00fcmler i\u00e7in g\u00fc\u00e7l\u00fc metotlar sunar.<\/p>\n<p>*   <strong>Dizeden Tarih\/Saat Nesnesine:<\/strong> <code>parse<\/code> metotlar\u0131, \u00e7e\u015fitli dize formatlar\u0131n\u0131 otomatik olarak alg\u0131layabilir.<\/p>\n<pre><code class=\"language-ruby\">require 'date'\n\n    Date.parse(\"2023-10-27\")            # => #<Date: 2023-10-27 ((2460245j,0s,0ns),+0s,2299161j)>\n    Time.parse(\"2023-10-27 14:30:00\")   # => 2023-10-27 14:30:00 +0300\n    DateTime.parse(\"October 27th, 2023 2:30 PM\") # => #<DateTime: 2023-10-27T14:30:00+00:00 ...><\/code><\/pre>\n<p>*   <strong>Tarih\/Saat Nesnesinden Dizeye:<\/strong> <code>strftime<\/code> metodu, tarih ve saat nesnelerini \u00f6zel formatlara g\u00f6re dizeye d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in kullan\u0131l\u0131r.<\/p>\n<pre><code class=\"language-ruby\">now = Time.now\n    now.strftime(\"%Y-%m-%d %H:%M:%S\") # => \"2023-10-27 14:30:00\" (\u00f6rnek \u00e7\u0131kt\u0131)\n    now.strftime(\"%A, %d %B %Y\")      # => \"Cuma, 27 Ekim 2023\" (\u00f6rnek \u00e7\u0131kt\u0131)<\/code><\/pre>\n<p>*   <strong>Unix Timestamp D\u00f6n\u00fc\u015f\u00fcmleri:<\/strong><\/p>\n<pre><code class=\"language-ruby\">Time.at(1678886400) # Unix timestamp'ten Time nesnesine (15 Mart 2023 00:00:00 UTC)\n    Time.now.to_i       # Time nesnesinden Unix timestamp'e (Integer)<\/code><\/pre>\n<h4>Nesneye \u00d6zel <code>to_s<\/code>, <code>to_i<\/code>, vb. Metotlar<\/h4>\n<p>Kendi s\u0131n\u0131flar\u0131n\u0131z\u0131 tan\u0131mlarken, bu s\u0131n\u0131flar\u0131n di\u011fer veri t\u00fcrlerine nas\u0131l d\u00f6n\u00fc\u015ft\u00fcr\u00fclece\u011fini belirlemek i\u00e7in <code>to_s<\/code>, <code>to_i<\/code>, <code>to_f<\/code>, <code>to_a<\/code>, <code>to_h<\/code>, <code>to_sym<\/code> gibi metotlar\u0131 override edebilirsiniz. Bu, Ruby&#8217;nin polimorfizm yetene\u011fini kullanarak nesnelerinizin farkl\u0131 ba\u011flamlarda tutarl\u0131 davranmas\u0131n\u0131 sa\u011flar.<\/p>\n<pre><code class=\"language-ruby\">class Kullanici\n  attr_reader :ad, :yas\n\n  def initialize(ad, yas)\n    @ad = ad\n    @yas = yas\n  end\n\n  def to_s\n    \"Kullan\u0131c\u0131: #{ad}, Ya\u015f: #{yas}\"\n  end\n\n  def to_i\n    yas\n  end\n\n  def to_h\n    {ad: ad, yas: yas}\n  end\nend\n\nk = Kullanici.new(\"Ay\u015fe\", 30)\nputs k.to_s        # => \"Kullan\u0131c\u0131: Ay\u015fe, Ya\u015f: 30\"\nputs k.to_i        # => 30\nputs k.to_h        # => {:ad=>\"Ay\u015fe\", :yas=>30}<\/code><\/pre>\n<h4>JSON ve YAML ile Veri D\u00f6n\u00fc\u015f\u00fcm\u00fc<\/h4>\n<p>Web uygulamalar\u0131nda ve veri al\u0131\u015fveri\u015finde JSON (JavaScript Object Notation) ve YAML (YAML Ain&#8217;t Markup Language) formatlar\u0131 yayg\u0131n olarak kullan\u0131l\u0131r. Ruby, bu formatlar\u0131 yerle\u015fik <code>JSON<\/code> ve <code>YAML<\/code> k\u00fct\u00fcphaneleri arac\u0131l\u0131\u011f\u0131yla Ruby nesnelerine d\u00f6n\u00fc\u015ft\u00fcrme ve Ruby nesnelerini bu formatlara d\u00f6n\u00fc\u015ft\u00fcrme yetene\u011fi sunar.<\/p>\n<p>*   <strong>JSON Dizesinden Ruby Nesnesine:<\/strong><\/p>\n<pre><code class=\"language-ruby\">require 'json'\n\n    json_string = '{\"name\": \"Mehmet\", \"age\": 40, \"isStudent\": false}'\n    ruby_hash = JSON.parse(json_string)\n    puts ruby_hash[\"name\"] # => Mehmet\n    puts ruby_hash[\"age\"]  # => 40<\/code><\/pre>\n<p>    <code>JSON.parse<\/code> varsay\u0131lan olarak anahtarlar\u0131 dize olarak d\u00f6nd\u00fcr\u00fcr. Sembol anahtarlar\u0131 istiyorsan\u0131z: <code>JSON.parse(json_string, symbolize_names: true)<\/code>.<\/p>\n<p>*   <strong>Ruby Nesnesinden JSON Dizesine:<\/strong><\/p>\n<pre><code class=\"language-ruby\">require 'json'\n\n    ruby_data = {product: \"Laptop\", price: 1200.50, inStock: true}\n    json_output = JSON.generate(ruby_data)\n    puts json_output # => {\"product\":\"Laptop\",\"price\":1200.5,\"inStock\":true}<\/code><\/pre>\n<p>    <code>to_json<\/code> metodu da kullan\u0131labilir (nesneye dahil edilmi\u015fse).<\/p>\n<p>*   <strong>YAML Dizesinden Ruby Nesnesine:<\/strong><\/p>\n<pre><code class=\"language-ruby\">require 'yaml'\n\n    yaml_string = \"\n    ---\n    person:\n      name: Ali\n      occupation: Engineer\n    \"\n    ruby_hash = YAML.load(yaml_string)\n    puts ruby_hash[\"person\"][\"name\"] # => Ali<\/code><\/pre>\n<p>*   <strong>Ruby Nesnesinden YAML Dizesine:<\/strong><\/p>\n<pre><code class=\"language-ruby\">require 'yaml'\n\n    ruby_data = {book: {title: \"Ruby Programming\", author: \"Yazar\"}}\n    yaml_output = YAML.dump(ruby_data)\n    puts yaml_output\n    # ---\n    # :book:\n    #   :title: Ruby Programming\n    #   :author: Yazar<\/code><\/pre>\n<h4>Type Coercion (T\u00fcr Zorlama)<\/h4>\n<p>Ruby, baz\u0131 durumlarda otomatik t\u00fcr zorlama (coercion) yapar. \u00d6zellikle aritmetik i\u015flemlerde, farkl\u0131 say\u0131sal t\u00fcrler bir araya geldi\u011finde, daha genel olan t\u00fcre d\u00f6n\u00fc\u015f\u00fcm ger\u00e7ekle\u015fir.<\/p>\n<pre><code class=\"language-ruby\">10 + 5.5 # => 15.5 (Integer Float'a zorland\u0131)<\/code><\/pre>\n<p>Kendi s\u0131n\u0131flar\u0131n\u0131z aras\u0131nda t\u00fcr zorlamay\u0131 desteklemek isterseniz, <code>coerce<\/code> metodunu kullanabilirsiniz. Bu, genellikle matematiksel operat\u00f6rlerin farkl\u0131 t\u00fcrdeki nesnelerle \u00e7al\u0131\u015fmas\u0131n\u0131 sa\u011flamak i\u00e7in ileri d\u00fczey bir konudur.<\/p>\n<pre><code class=\"language-ruby\">class MyNumber\n  attr_reader :value\n  def initialize(value)\n    @value = value\n  end\n\n  def +(other)\n    if other.is_a?(MyNumber)\n      MyNumber.new(@value + other.value)\n    else\n      x, y = other.coerce(self) # Burada di\u011fer nesnenin coerce metodu \u00e7a\u011fr\u0131l\u0131r\n      x + y\n    end\n  end\n\n  def coerce(other)\n    [MyNumber.new(other), self] # Di\u011fer nesneyi MyNumber'a d\u00f6n\u00fc\u015ft\u00fcr\u00fcp kendimizi d\u00f6nd\u00fcr\u00fcr\u00fcz\n  end\n\n  def to_s\n    @value.to_s\n  end\nend\n\nnum = MyNumber.new(10)\nputs (num + 5).to_s # => 15 (5, MyNumber'a d\u00f6n\u00fc\u015ft\u00fcr\u00fcld\u00fc)<\/code><\/pre>\n<h4>Hata Y\u00f6netimi<\/h4>\n<p>Veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme i\u015flemleri s\u0131ras\u0131nda hatalar\u0131n do\u011fru bir \u015fekilde ele al\u0131nmas\u0131 \u00e7ok \u00f6nemlidir. \u00d6zellikle kullan\u0131c\u0131 giri\u015fleri veya d\u0131\u015f sistemlerden gelen verilerle \u00e7al\u0131\u015f\u0131rken beklenmedik formatlar veya ge\u00e7ersiz de\u011ferler d\u00f6n\u00fc\u015f\u00fcm hatalar\u0131na yol a\u00e7abilir.<\/p>\n<p>*   <strong><code>begin...rescue<\/code> Bloklar\u0131:<\/strong> <code>Kernel<\/code> metotlar\u0131 (\u00f6rne\u011fin <code>Integer()<\/code>) hata f\u0131rlatt\u0131\u011f\u0131nda, bu hatalar\u0131 yakalamak i\u00e7in <code>begin...rescue<\/code> bloklar\u0131 kullan\u0131labilir.<\/p>\n<pre><code class=\"language-ruby\">def string_to_integer_safe(str)\n      begin\n        Integer(str)\n      rescue ArgumentError, TypeError\n        puts \"Hata: Ge\u00e7ersiz say\u0131 format\u0131 veya t\u00fcr\u00fc '#{str}'\"\n        0 # Varsay\u0131lan bir de\u011fer d\u00f6nd\u00fcr veya nil\n      end\n    end\n\n    puts string_to_integer_safe(\"123\")   # => 123\n    puts string_to_integer_safe(\"abc\")   # Hata: Ge\u00e7ersiz say\u0131 format\u0131 veya t\u00fcr\u00fc 'abc' \\n 0\n    puts string_to_integer_safe(nil)     # Hata: Ge\u00e7ersiz say\u0131 format\u0131 veya t\u00fcr\u00fc '' \\n 0<\/code><\/pre>\n<p>*   <strong><code>to_<\/code> Metotlar\u0131n\u0131n G\u00fcvenli Kullan\u0131m\u0131:<\/strong> <code>to_i<\/code>, <code>to_f<\/code> gibi metotlar hata f\u0131rlatmaz, bunun yerine ge\u00e7ersiz giri\u015f i\u00e7in <code>0<\/code> veya <code>0.0<\/code> gibi varsay\u0131lan de\u011ferler d\u00f6nd\u00fcr\u00fcr. Bu davran\u0131\u015f her zaman istenmeyebilir, bu y\u00fczden d\u00f6n\u00fc\u015f\u00fcmden sonra de\u011ferin ge\u00e7erlili\u011fini kontrol etmek gerekebilir.<\/p>\n<pre><code class=\"language-ruby\">input = \"abc\"\n    num = input.to_i\n    if num == 0 && input != \"0\" # E\u011fer input \"0\" de\u011filse ve num 0 ise, bu genellikle ge\u00e7ersiz bir giri\u015ftir\n      puts \"Hata: Ge\u00e7ersiz say\u0131sal giri\u015f.\"\n    else\n      puts \"D\u00f6n\u00fc\u015ft\u00fcr\u00fclen say\u0131: #{num}\"\n    end<\/code><\/pre>\n<h3>En \u0130yi Uygulamalar ve Dikkat Edilmesi Gerekenler<\/h3>\n<p>Veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme i\u015flemleri, kodun karma\u015f\u0131kl\u0131\u011f\u0131n\u0131 ve hata potansiyelini art\u0131rabilir. Bu nedenle, baz\u0131 en iyi uygulamalar\u0131 takip etmek \u00f6nemlidir.<\/p>\n<p>*   <strong>A\u00e7\u0131kl\u0131k ve Okunabilirlik:<\/strong> D\u00f6n\u00fc\u015f\u00fcmlerin neden yap\u0131ld\u0131\u011f\u0131n\u0131 ve hangi t\u00fcrden hangi t\u00fcre d\u00f6n\u00fc\u015ft\u00fcr\u00fcld\u00fc\u011f\u00fcn\u00fc kodunuzda a\u00e7\u0131k\u00e7a belirtin. Gerekirse yorumlar ekleyin.<br \/>\n*   <strong>Do\u011fru Metodu Se\u00e7in:<\/strong> <code>to_i<\/code> mi yoksa <code>Integer()<\/code> m\u0131 kullanaca\u011f\u0131n\u0131z, hata y\u00f6netim stratejinize ba\u011fl\u0131d\u0131r. Hata f\u0131rlatmay\u0131 tercih ediyorsan\u0131z <code>Kernel<\/code> metotlar\u0131n\u0131, sessiz d\u00f6n\u00fc\u015f\u00fcm\u00fc tercih ediyorsan\u0131z <code>to_<\/code> metotlar\u0131n\u0131 kullan\u0131n.<br \/>\n*   <strong>Veri Do\u011frulama (Validation):<\/strong> \u00d6zellikle kullan\u0131c\u0131 giri\u015finden veya d\u0131\u015f sistemlerden gelen verileri d\u00f6n\u00fc\u015ft\u00fcrmeden \u00f6nce her zaman do\u011frulay\u0131n. \u00d6rne\u011fin, bir e-posta adresini bir dizeye d\u00f6n\u00fc\u015ft\u00fcrmek kolayd\u0131r, ancak ge\u00e7erli bir e-posta format\u0131nda olup olmad\u0131\u011f\u0131n\u0131 kontrol etmek ayr\u0131 bir ad\u0131md\u0131r.<br \/>\n*   <strong>Performans:<\/strong> B\u00fcy\u00fck veri setlerinde veya s\u0131k tekrar eden d\u00f6ng\u00fclerde yap\u0131lan d\u00f6n\u00fc\u015f\u00fcmlerin performans\u0131 \u00fczerinde d\u00fc\u015f\u00fcn\u00fcn. Gereksiz veya yinelenen d\u00f6n\u00fc\u015f\u00fcmlerden ka\u00e7\u0131n\u0131n.<br \/>\n*   <strong>Tutarl\u0131l\u0131k:<\/strong> Proje genelinde veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme i\u00e7in tutarl\u0131 bir yakla\u015f\u0131m benimseyin. Bu, kod taban\u0131n\u0131n bak\u0131m\u0131n\u0131 kolayla\u015ft\u0131r\u0131r.<br \/>\n*   <strong>Ruby&#8217;nin &#8220;Truthiness&#8221; Kurallar\u0131:<\/strong> Ruby&#8217;de <code>nil<\/code> ve <code>false<\/code> d\u0131\u015f\u0131ndaki t\u00fcm nesneler <code>true<\/code> olarak de\u011ferlendirilir. Bu, ko\u015fullu ifadelerde beklenmedik davran\u0131\u015flara yol a\u00e7abilir. \u00d6rne\u011fin, <code>0<\/code> veya bo\u015f bir dize (<code>\"\"<\/code>) <code>true<\/code> olarak kabul edilir. Bu kural\u0131 her zaman akl\u0131n\u0131zda bulundurun.<\/p>\n<pre><code class=\"language-ruby\">if 0\n      puts \"0 true olarak kabul edilir\" # Bu sat\u0131r \u00e7al\u0131\u015f\u0131r\n    end\n\n    if \"\"\n      puts \"Bo\u015f dize true olarak kabul edilir\" # Bu sat\u0131r \u00e7al\u0131\u015f\u0131r\n    end\n\n    if nil\n      puts \"nil true olarak kabul edilmez\" # Bu sat\u0131r \u00e7al\u0131\u015fmaz\n    end<\/code><\/pre>\n<h3>Sonu\u00e7<\/h3>\n<p>Ruby&#8217;de veri t\u00fcr\u00fc d\u00f6n\u00fc\u015ft\u00fcrme, dilin dinamik do\u011fas\u0131n\u0131n ayr\u0131lmaz bir par\u00e7as\u0131d\u0131r ve geli\u015ftiricilere veriler \u00fczerinde b\u00fcy\u00fck bir esneklik ve kontrol sa\u011flar. Temel <code>to_<\/code> metotlar\u0131ndan <code>Kernel<\/code> mod\u00fcl\u00fcn\u00fcn hata f\u0131rlatan metotlar\u0131na, tarih\/saat d\u00f6n\u00fc\u015f\u00fcmlerinden JSON\/YAML ayr\u0131\u015ft\u0131rmaya kadar geni\u015f bir ara\u00e7 yelpazesi mevcuttur. Kendi s\u0131n\u0131flar\u0131n\u0131zda d\u00f6n\u00fc\u015f\u00fcm metotlar\u0131n\u0131 override ederek polimorfik davran\u0131\u015flar sergileyebilir, b\u00f6ylece kodunuzu daha mod\u00fcler ve okunabilir hale getirebilirsiniz.<\/p>\n<p>Do\u011fru d\u00f6n\u00fc\u015f\u00fcm y\u00f6ntemini se\u00e7mek, hata y\u00f6netimini iyi planlamak ve en iyi uygulamalar\u0131 takip etmek, temiz, g\u00fcvenli ve s\u00fcrd\u00fcr\u00fclebilir Ruby uygulamalar\u0131 geli\u015ftirmenin anahtar\u0131d\u0131r. Bu makalede ele al\u0131nan teknikler ve ipu\u00e7lar\u0131, Ruby projelerinizde veri t\u00fcr\u00fc d\u00f6n\u00fc\u015f\u00fcmlerini daha etkin bir \u015fekilde y\u00f6netmenize yard\u0131mc\u0131 olacakt\u0131r.<\/body><\/p>\n","protected":false},"excerpt":{"rendered":"Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?\nRuby, dinamik ve esnek bir programlama dilidir. Bu esneklik, geli\u015ftiricilere veri t\u00fcrleri \u00fczerind","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-34127","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-genel","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ruby&#039;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby&#039;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?\" \/>\n<meta property=\"og:description\" content=\"Ruby&#039;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr? Ruby, dinamik ve esnek bir programlama dilidir. Bu esneklik, geli\u015ftiricilere veri t\u00fcrleri \u00fczerind\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-11T11:40:52+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?\",\"datePublished\":\"2025-11-11T11:40:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\"},\"wordCount\":2208,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#respond\"]}],\"copyrightYear\":\"2025\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\",\"name\":\"Ruby'de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2025-11-11T11:40:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ruby'de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/","og_locale":"tr_TR","og_type":"article","og_title":"Ruby'de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?","og_description":"Ruby'de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr? Ruby, dinamik ve esnek bir programlama dilidir. Bu esneklik, geli\u015ftiricilere veri t\u00fcrleri \u00fczerind","og_url":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2025-11-11T11:40:52+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"16 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?","datePublished":"2025-11-11T11:40:52+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/"},"wordCount":2208,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#respond"]}],"copyrightYear":"2025","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/","url":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/","name":"Ruby'de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr? - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2025-11-11T11:40:52+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/rubyde-veri-turleri-nasil-donusturulur\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ruby&#8217;de Veri T\u00fcrleri Nas\u0131l D\u00f6n\u00fc\u015ft\u00fcr\u00fcl\u00fcr?"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=34127"}],"version-history":[{"count":1,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34127\/revisions"}],"predecessor-version":[{"id":34128,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34127\/revisions\/34128"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=34127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=34127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=34127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}