{"id":6740,"date":"2012-09-24T20:12:48","date_gmt":"2012-09-24T14:42:48","guid":{"rendered":"https:\/\/2thenew.xyz\/blog\/?p=6740"},"modified":"2015-08-26T15:28:57","modified_gmt":"2015-08-26T09:58:57","slug":"metaprogramming-with-metaclass","status":"publish","type":"post","link":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/","title":{"rendered":"MetaProgramming with MetaClass"},"content":{"rendered":"<p>As we all know that <strong>groovy<\/strong> is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of <strong>metaProgamming<\/strong> given below, in which we are adding a method (isEvent) into an Integer class.<\/p>\n<p>[groovy]<br \/>\nInteger.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign indicates that isEven() method is no argument method<br \/>\n    delegate%2 == 0<br \/>\n}<br \/>\n[\/groovy]<\/p>\n<p>When we see the above program few questions arise in our mind, what is <strong>metaClass<\/strong>? What is <strong>delegate<\/strong>?? How <strong>metaprogramming<\/strong> is actually working?? How to disable <strong>MetaProgramming<\/strong>?? isEven() method a static or instance method?? etc&#8230; Let\u2019s move on to every question one by one.<\/p>\n<p>1. What is <strong>metaClass<\/strong>?? In <strong>Groovy<\/strong> Language, every object has an object of <strong>MetaClass<\/strong> class with name <strong>metaClass<\/strong>. This <strong>metaClass<\/strong> object is responsible for holding all the information related to that object. Whenever you perform any operation on that object, <strong>Groovy&#8217;s<\/strong> dispatch mechanism routes the call through that <strong>Metaclass<\/strong> object(<strong>metaClass<\/strong>). So if you want to change the behaviour of any object\/class, you will have to alter the <strong>MetaClass<\/strong> object attached to that class\/object, and it will alter the behaviour of that class\/object at run time.<\/p>\n<p>2. What is <strong>delegate<\/strong>?? We can say <strong>delegate<\/strong> is reference of that object who is invoking that isEven() method.<\/p>\n<p>3. How <strong>metaprogramming<\/strong> is actually working?? Whenever we call a method of class\/object, it first gets information of that object from <strong>metaClass<\/strong> attached to it, and then calls the appropriate method. In above program we are asking Integer <strong>metaClass<\/strong>, that there is an isEven() method in integer class, whose definition is followed by it. Now when we will call \u201canyInteger.isEven()\u201d, it will excute isEven() method and will return true\/false accordingly, e.g.<\/p>\n<p>[groovy]<br \/>\n9.isEven() \/\/ false<br \/>\n8.isEven() \/\/ true<br \/>\n[\/groovy]<\/p>\n<p>4. How to disable <strong>MetaProgramming<\/strong>?? Once a method is added into any class\/object, that method will be available in complete application. If you want remove that method from a particular situation you will have to assign <strong>null<\/strong> into<strong> Integer.metaClass<\/strong>. e.g.<\/p>\n<p>[groovy]<br \/>\nInteger.metaClass = null<br \/>\n7.isEven() \/\/ will throw MissingMethodException<br \/>\n[\/groovy]<\/p>\n<p>5. isEven() method is static or instance method?? isEven() is an instance method. To add a static method at run time, you will have to follow signature given below:<\/p>\n<p>[groovy]<br \/>\nInteger.metaClass.static.isEven = { number -&gt;<br \/>\n    number%2 == 0<br \/>\n}<br \/>\nInteger.isEven(1) \/\/ false<br \/>\nInteger.isEven(2) \/\/ true<br \/>\n[\/groovy]<\/p>\n<p>6. isEven() method is added to that object only?? No, isEven() method is added to all the Integer objects, if we want to add isEven() in a particular object only then we have to use that object reference .metaClass instead of Integer.metaClass, e.g.<\/p>\n<p>[groovy]<br \/>\nInteger aNumber = 9<br \/>\naNumber.metaClass.isEven = { -&gt;<br \/>\n    delegate%2 == 0<br \/>\n}<br \/>\nprintln aNumber.isEven() \/\/ false<br \/>\nprintln 2.isEven() \/\/ will throw MissingMethodException.<br \/>\n[\/groovy]<\/p>\n<p>7. How to add multiple methods?? To add the multiple method into single class see below example:<\/p>\n<p>[groovy]<br \/>\nInteger.metaClass {<br \/>\n    isEven { -&gt; delegate%2 == 0 }<br \/>\n    isOdd { -&gt; delegate%2 != 0 }<br \/>\n    \/\/ other methods<br \/>\n}<\/p>\n<p>println 6.isEven() \/\/ true<br \/>\nprintln 6.isOdd()  \/\/ false<br \/>\n[\/groovy]<\/p>\n<p><strong><a href=\"https:\/\/2thenew.xyz\/blog\/author\/amit-kumar\/\">More Blogs by Me<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":17,"footnotes":""},"categories":[7],"tags":[885,9,632,145],"class_list":["post-6740","post","type-post","status-publish","format-standard","hentry","category-grails","tag-delegate","tag-groovy","tag-metaclass","tag-metaprogramming"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Amit Kumar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"MetaProgramming with MetaClass | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"MetaProgramming with MetaClass | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#article\",\"name\":\"MetaProgramming with MetaClass | TO THE NEW Blog\",\"headline\":\"MetaProgramming with MetaClass\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2012-09-24T20:12:48+05:30\",\"dateModified\":\"2015-08-26T15:28:57+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#webpage\"},\"articleSection\":\"Grails, delegate, Groovy, metaClass, MetaProgramming\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"position\":2,\"name\":\"Grails\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#listItem\",\"name\":\"MetaProgramming with MetaClass\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#listItem\",\"position\":3,\"name\":\"MetaProgramming with MetaClass\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/\",\"name\":\"Amit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/859356966acd3c3879759369c7ac72cfb81228287bfc78e99c3080bee9b6b9ba?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Amit Kumar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/\",\"name\":\"MetaProgramming with MetaClass | TO THE NEW Blog\",\"description\":\"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -> \\\/\\\/ only (->) sign\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/metaprogramming-with-metaclass\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\"},\"datePublished\":\"2012-09-24T20:12:48+05:30\",\"dateModified\":\"2015-08-26T15:28:57+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"MetaProgramming with MetaClass | TO THE NEW Blog","description":"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -> \/\/ only (->) sign","canonical_url":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#article","name":"MetaProgramming with MetaClass | TO THE NEW Blog","headline":"MetaProgramming with MetaClass","author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/amit-kumar\/#author"},"publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"},"datePublished":"2012-09-24T20:12:48+05:30","dateModified":"2015-08-26T15:28:57+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#webpage"},"articleSection":"Grails, delegate, Groovy, metaClass, MetaProgramming"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.xyz\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/2thenew.xyz\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#listItem","name":"MetaProgramming with MetaClass"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#listItem","position":3,"name":"MetaProgramming with MetaClass","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.xyz\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.xyz\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.xyz\/blog\/author\/amit-kumar\/#author","url":"https:\/\/2thenew.xyz\/blog\/author\/amit-kumar\/","name":"Amit Kumar","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/859356966acd3c3879759369c7ac72cfb81228287bfc78e99c3080bee9b6b9ba?s=96&d=mm&r=g","width":96,"height":96,"caption":"Amit Kumar"}},{"@type":"WebPage","@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#webpage","url":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/","name":"MetaProgramming with MetaClass | TO THE NEW Blog","description":"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -> \/\/ only (->) sign","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/amit-kumar\/#author"},"creator":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/amit-kumar\/#author"},"datePublished":"2012-09-24T20:12:48+05:30","dateModified":"2015-08-26T15:28:57+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.xyz\/blog\/#website","url":"https:\/\/2thenew.xyz\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"MetaProgramming with MetaClass | TO THE NEW Blog","og:description":"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign","og:url":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/","og:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"MetaProgramming with MetaClass | TO THE NEW Blog","twitter:description":"As we all know that groovy is a dynamic programming language, so we can add any method to any class at runtime. First, let\u2019s see a small and simple example of metaProgamming given below, in which we are adding a method (isEvent) into an Integer class. [groovy] Integer.metaClass.isEven = { -&gt; \/\/ only (-&gt;) sign","twitter:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"6740","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 19:49:34","updated":"2024-02-29 09:31:27","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\/category\/grails\/\" title=\"Grails\">Grails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMetaProgramming with MetaClass\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.xyz\/blog"},{"label":"Grails","link":"https:\/\/2thenew.xyz\/blog\/category\/grails\/"},{"label":"MetaProgramming with MetaClass","link":"https:\/\/2thenew.xyz\/blog\/metaprogramming-with-metaclass\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/6740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/comments?post=6740"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/6740\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/media?parent=6740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/categories?post=6740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/tags?post=6740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}