{"id":3560,"date":"2019-09-03T07:23:00","date_gmt":"2019-09-03T07:23:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/"},"modified":"2026-04-27T09:52:00","modified_gmt":"2026-04-27T09:52:00","slug":"ruby-3-0-ruby-i-mniej-znane-metody-kontroli-prywatnosci","status":"publish","type":"post","link":"https:\/\/thecodest.co\/pl\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/","title":{"rendered":"Ruby 3.0. Ruby i mniej znane metody kontroli prywatno\u015bci"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Podstawowe rozwi\u0105zania<\/h2>\n\n\n\n<p>Za\u0142\u00f3\u017cmy, \u017ce u\u017cywamy klasy Foo, kt\u00f3ra ma jedn\u0105 metod\u0119 publiczn\u0105 i jedn\u0105 prywatn\u0105:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">klasa Foo\n  def bar\n    :awesome\n  end\n\n  prywatny\n\n  def baz\n    something_private\n  end\nend<\/code><\/pre>\n\n\n\n<p>Wszystko \u015bwietnie, widzimy takie rozwi\u0105zanie praktycznie w ka\u017cdym <a href=\"https:\/\/thecodest.co\/pl\/dictionary\/why-do-projects-fail\/\">projekt<\/a>. Bieganie <code>Foo.new.baz<\/code> spowoduje b\u0142\u0105d <em>NoMethodError (prywatna metoda 'baz' wywo\u0142ana dla #)<\/em> i to w\u0142a\u015bnie chcieli\u015bmy zrobi\u0107. Co si\u0119 stanie, je\u015bli spr\u00f3bujemy zmieni\u0107 format zapisu i dodamy private jako przedrostek w definicji klasy?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">klasa Foo\n  def bar\n    :awesome\n  end\n\n  private def baz\n    :something_private\n  end\nend<\/code><\/pre>\n\n\n\n<p>Jak wida\u0107 po uruchomieniu <a href=\"https:\/\/thecodest.co\/pl\/dictionary\/what-is-code-refactoring\/\">kod<\/a>to faktycznie dzia\u0142a! Dlaczego mo\u017cemy wprowadzi\u0107 widoczno\u015b\u0107 metody przed jej wykonaniem? Poniewa\u017c podczas definiowania metody, def zwraca nazw\u0119 metody jako symbol. Wyra\u017cenie to jest nie tylko cz\u0119\u015bci\u0105 sk\u0142adni, ale de facto metod\u0105 wywodz\u0105c\u0105 si\u0119 z klasy Module i traktuj\u0105c\u0105 ten symbol jako argument. Wi\u0119cej informacji mo\u017cna znale\u017a\u0107 w dokumentacji <a href=\"https:\/\/ruby-doc.org\/core-3.0.0\/Module.html#method-i-private\">w tym linku<\/a>. Skoro zacz\u0119\u0142o si\u0119 tak \u0142atwo od private, spr\u00f3bujmy zmieni\u0107 widoczno\u015b\u0107 metody prywatnej.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">klasa Foo\n  def bar\n    :awesome\n  end\n\n  private def baz\n    :something_private\n  end\n\n  public :baz\nend<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Co si\u0119 stanie po uruchomieniu kodu?<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">irb(main):012:0&gt; Foo.new.baz\n=&gt; :something_private<\/code><\/pre>\n\n\n\n<p>Sukces! Nasza metoda baz sta\u0142a si\u0119 publiczna, poniewa\u017c uwidocznili\u015bmy j\u0105 dwukrotnie. Oczywi\u015bcie ta sama operacja dotyczy modu\u0142\u00f3w.<br>\u200b<br>\u015awietnie, ale sk\u0105d to si\u0119 bierze? <a href=\"https:\/\/thecodest.co\/pl\/blog\/why-us-companies-are-opting-for-polish-developers\/\">my<\/a>?<br>\u200b<br>Ta funkcjonalno\u015b\u0107 daje nam wiele, poniewa\u017c mo\u017cemy dowolnie zmienia\u0107 widoczno\u015b\u0107 metody podczas jej definiowania, a nawet zmienia\u0107 widoczno\u015b\u0107 metod podczas ich dziedziczenia.<\/p>\n\n\n\n<p>Przyjrzyjmy si\u0119 teraz temu, co <a href=\"https:\/\/thecodest.co\/pl\/blog\/hire-ror-developer\/\">Ruby<\/a> 2.7 mo\u017ce zmieni\u0107 widoczno\u015b\u0107 alias\u00f3w i akcesor\u00f3w.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Foo\n  private attr_accessor :awesome_variable\nend<\/code><\/pre>\n\n\n\n<p>Niestety, otrzymujemy b\u0142\u0105d, poniewa\u017c metoda prywatna oczekuje symboli i attr_accessor. Kod zwraca nil, a zatem ta metoda nie jest zgodna z prywatnym u\u017cyciem w Ruby 2.7. Jakie wi\u0119c mamy opcje?<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Mo\u017cemy u\u017cy\u0107 attr_accessor pod s\u0142owem kluczowym private, aby to zadzia\u0142a\u0142o, tj. otrzymamy b\u0142\u0105d, gdy b\u0119dziemy chcieli odwo\u0142a\u0107 si\u0119 do <code>awesome_variableawesome_variable<\/code> metoda.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Foo\n  prywatny\n\n  attr_accessor :awesome_variable\nend<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Drug\u0105 opcj\u0105 jest wykonanie metody prywatnej na metodach wygenerowanych przez <code>attr_attribute<\/code>W tym przypadku musimy r\u00f3wnie\u017c pami\u0119ta\u0107 o wpisaniu tam settera.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Foo\n  attr_accessor :awesome_variable\n\n  private :awesome_variable, :awesome_variable=\nend<\/code><\/pre>\n\n\n\n<p>Problemy z <code>attr_ *<\/code> nie s\u0105 jedynymi przeszkodami. T\u0119 sam\u0105 trudno\u015b\u0107 mo\u017cemy napotka\u0107, gdy chcemy utworzy\u0107 prywatny alias.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Foo\n  private alias :bar, :awesome_bar\nend<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ruby 3.0 i nasza dzia\u0142alno\u015b\u0107<\/h2>\n\n\n\n<p>Na szcz\u0119\u015bcie Ruby 3.0 wprowadza \u015bwietn\u0105 zmian\u0119, poniewa\u017c metody widoczno\u015bci mog\u0105 przyjmowa\u0107 tablic\u0119 jako argument, a alias metod, attr_ *, mo\u017ce zresetowa\u0107 tablic\u0119 z nazwami metod, kt\u00f3re zosta\u0142y zdefiniowane. Mo\u017cesz przeczyta\u0107 wi\u0119cej <a href=\"https:\/\/redmine.ruby-lang.org\/issues\/17314\">tutaj<\/a>.<\/p>\n\n\n\n<p>Zobaczmy teraz kilka przyk\u0142ad\u00f3w w najnowszym euba i sprawd\u017amy, czy zmiany zosta\u0142y faktycznie wprowadzone i jak mo\u017cemy z nich korzysta\u0107.<br>\u200b<br>W pierwszym przyk\u0142adzie u\u017cyjmy private przed attr accessor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Foo\n  private attr_accessor :awesome_variable\nend<\/code><\/pre>\n\n\n\n<p>Takie wywo\u0142anie nie spowoduje b\u0142\u0119d\u00f3w w parsowaniu sk\u0142adni i, co wa\u017cne, nie spowoduje b\u0142\u0119d\u00f3w w dzia\u0142aniu funkcji <code>awesome_variable<\/code> i<code>awesome_variable =<\/code>metody staj\u0105 si\u0119 prywatne.<br>\u200b<br>Metoda aliasu zrobi to samo, ale teraz r\u00f3wnie\u017c zwraca symbol jako nazw\u0119 nowej metody i czyni j\u0105 widoczn\u0105.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Foo\n  private alias :bar, :awesome_bar\nend<\/code><\/pre>\n\n\n\n<p>Ciekawostk\u0105 jest fakt, \u017ce mo\u017cemy r\u00f3wnie\u017c zag\u0142\u0119bi\u0107 si\u0119 w kolejne metody, np. rewelacyjn\u0105<em>modu\u0142 print mo\u017ce by\u0107 wywo\u0142any pomi\u0119dzy private i attr<\/em>reader; wa\u017cne jest, aby taka metoda zwraca\u0142a tablic\u0119 z nazwami metod, kt\u00f3re znajduj\u0105 si\u0119 po prawej stronie wyra\u017cenia.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Modu\u0142\n  def awesome_print(names)\n    puts names\n    nazwy\n  end\nend\nclass Foo\n  private awesome_print attr_reader :awesome_bar\nend<span style=\"background-color: initial; font-family: inherit; font-size: inherit;\"> <\/span><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Podsumowanie<\/h2>\n\n\n\n<p>Mamy nadziej\u0119, \u017ce ten artyku\u0142 oka\u017ce si\u0119 przydatny! W przypadku dalszych wiadomo\u015bci o Ruby 3.0. czytaj dalej <a href=\"https:\/\/rubyreferences.github.io\/rubychanges\/3.0.html\">tutaj<\/a>.<\/p>\n\n\n\n<p>Szcz\u0119\u015bliwego kodowania!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/thecodest.co\/careers#offers]\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/ruby-1-.png\" alt=\"Oferta dla programist\u00f3w Ruby\"\/><\/a><\/figure>\n\n\n\n<p><strong>Czytaj wi\u0119cej:<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/shut-up-and-take-your-money-1-hidden-costs-and-real-agility-in-product-development-process\/\">Zamknij si\u0119 i bierz swoje pieni\u0105dze #1: Ukryte koszty i prawdziwa elastyczno\u015b\u0107 w procesie rozwoju produktu<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/cto-challenges-scale-up-and-growth-of-software-products\/\">Wyzwania CTO - skalowanie i rozw\u00f3j oprogramowania<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Jedn\u0105 z najbardziej lubianych cech Rubiego jest jego bardzo elastyczna sk\u0142adnia. Osobi\u015bcie uwielbiam Rubiego za to, jak wiele mo\u017cliwo\u015bci mamy w definiowaniu klas i ich w\u0142a\u015bciwo\u015bci, i to w\u0142a\u015bnie om\u00f3wi\u0119 w tym artykule.<\/p>","protected":false},"author":2,"featured_media":3561,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Ruby 3.0. Ruby and lesser known privacy control methods - The Codest<\/title>\n<meta name=\"description\" content=\"One of the most beloved features of Ruby is its very flexible syntax. Personally, I love Ruby for how many possibilities we have in defining classes and their properties, and this is what I will discuss in this article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/pl\/blog\/ruby-3-0-ruby-i-mniej-znane-metody-kontroli-prywatnosci\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby 3.0. Ruby and lesser known privacy control methods\" \/>\n<meta property=\"og:description\" content=\"One of the most beloved features of Ruby is its very flexible syntax. Personally, I love Ruby for how many possibilities we have in defining classes and their properties, and this is what I will discuss in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/pl\/blog\/ruby-3-0-ruby-i-mniej-znane-metody-kontroli-prywatnosci\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-03T07:23:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-27T09:52:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_3.0.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Ruby 3.0. Ruby and lesser known privacy control methods\",\"datePublished\":\"2019-09-03T07:23:00+00:00\",\"dateModified\":\"2026-04-27T09:52:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/\"},\"wordCount\":588,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_3.0.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/\",\"name\":\"Ruby 3.0. Ruby and lesser known privacy control methods - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_3.0.png\",\"datePublished\":\"2019-09-03T07:23:00+00:00\",\"dateModified\":\"2026-04-27T09:52:00+00:00\",\"description\":\"One of the most beloved features of Ruby is its very flexible syntax. Personally, I love Ruby for how many possibilities we have in defining classes and their properties, and this is what I will discuss in this article.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#breadcrumb\"},\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_3.0.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_3.0.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby 3.0. Ruby and lesser known privacy control methods\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pl-PL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/pl\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ruby 3.0. Ruby i mniej znane metody kontroli prywatno\u015bci - The Codest","description":"Jedn\u0105 z najbardziej lubianych cech Rubiego jest jego bardzo elastyczna sk\u0142adnia. Osobi\u015bcie uwielbiam Rubiego za to, jak wiele mo\u017cliwo\u015bci mamy w definiowaniu klas i ich w\u0142a\u015bciwo\u015bci, i to w\u0142a\u015bnie om\u00f3wi\u0119 w tym artykule.","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:\/\/thecodest.co\/pl\/blog\/ruby-3-0-ruby-i-mniej-znane-metody-kontroli-prywatnosci\/","og_locale":"pl_PL","og_type":"article","og_title":"Ruby 3.0. Ruby and lesser known privacy control methods","og_description":"One of the most beloved features of Ruby is its very flexible syntax. Personally, I love Ruby for how many possibilities we have in defining classes and their properties, and this is what I will discuss in this article.","og_url":"https:\/\/thecodest.co\/pl\/blog\/ruby-3-0-ruby-i-mniej-znane-metody-kontroli-prywatnosci\/","og_site_name":"The Codest","article_published_time":"2019-09-03T07:23:00+00:00","article_modified_time":"2026-04-27T09:52:00+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_3.0.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"3 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Ruby 3.0. Ruby and lesser known privacy control methods","datePublished":"2019-09-03T07:23:00+00:00","dateModified":"2026-04-27T09:52:00+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/"},"wordCount":588,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_3.0.png","articleSection":["Software Development"],"inLanguage":"pl-PL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/","url":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/","name":"Ruby 3.0. Ruby i mniej znane metody kontroli prywatno\u015bci - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_3.0.png","datePublished":"2019-09-03T07:23:00+00:00","dateModified":"2026-04-27T09:52:00+00:00","description":"Jedn\u0105 z najbardziej lubianych cech Rubiego jest jego bardzo elastyczna sk\u0142adnia. Osobi\u015bcie uwielbiam Rubiego za to, jak wiele mo\u017cliwo\u015bci mamy w definiowaniu klas i ich w\u0142a\u015bciwo\u015bci, i to w\u0142a\u015bnie om\u00f3wi\u0119 w tym artykule.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/"]}]},{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_3.0.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_3.0.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/ruby-3-0-ruby-and-lesser-known-privacy-control-methods\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Ruby 3.0. Ruby and lesser known privacy control methods"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pl-PL"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/pl\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts\/3560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/comments?post=3560"}],"version-history":[{"count":14,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts\/3560\/revisions"}],"predecessor-version":[{"id":7980,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts\/3560\/revisions\/7980"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/media\/3561"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/media?parent=3560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/categories?post=3560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/tags?post=3560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}