struct   585

« earlier    

Ruby Objects and Dot Syntax
Person = Struct.new(:name, :city)
=> Person

person = Person.new('Rob', 'San Francisco')
=> #<struct Person name="Rob", city="San Francisco">

person.city
=> "San Francisco"


require 'ostruct'

person = OpenStruct.new
=> #<OpenStruct>

person.name = 'Rob'
=> "Rob"

person.city = 'San Francisco'
=> "San Francisco"

person.city
=> "San Francisco"
Ruby  struct  ostruct 
6 weeks ago by meFavs
The Go Playground
I *think* what is happening here is that "ignoring" S in the embedder causes the embedded struct's S to appear (since the parent's "S" is ignored).
go  golang  struct 
11 weeks ago by mjs
jpillora/opts: A Go (golang) package for building frictionless command-line interfaces
A Go (golang) package for building frictionless command-line interfaces - jpillora/opts
go  golang  flags  2019  struct  nested  json  config  important 
may 2019 by vonc
The simplicity and power of Ruby Struct - usage, performance, alternatives
Ruby Struct is a very useful built-in class that can simplify things but there are some details that make it not the best choice for every case.
ruby  struct 
february 2019 by beanish

« earlier    

related tags

12factor  2019  abstraction  anonymous  api  argument  array  article  ast  benchmark  bestpractices  blog  boilerplate  buffer  bug  bytes  c#  c++  c  callout  check  clang  class  classes  client  cobra  code  collection  compute  config  configuration  constructor  conversion  convert  converter  copy  cpp  create  csharp  custom  data-structure  data-structures  data  debug  decode  dependencyinjection  dev  development  di  dotnet  duck  elixir  embedded  embedded_types  embedding  empty  enum  enums  equals  erlang  error  evolution  extension  fake  flags  floss  form  format  function  functional-programming  functor  generation  generator  go  golang  gopherjs  goroutine  grammar  graph  handling  hash  howto  html  important  inheritance  initializers  interface  interfaces  interoperability  issue  java  json  jsonschema  june  kind  kwargs  learn  less  lexer  library  list  map  mapstructure  memory  merge  method  mixed  ml  native  nested  nlp  node.js  nsdata  null  object  ocaml  oop  opensource  operator  optimization  orm  ostruct  pack  package  packed  packing  parse  parser  parsing  patterns  performance  performane  pointee  pointer  prettify  prettyprinter  print  programming  programming_language  proposal  python  raywenderlich  reader  reading  readonly  record  redis  reference  report  restful  ruby  rust  set  sig  signature  simple  size  sml  sql  stream  string  structs  structure  swift  tag  teach  template  testable  testing  tie  tips  toml  trait  tuple  tutorial  type  typing  unittesting  unmarshal  unsafe  value  values  visualization  webassembly  workaround  writing  yaml 

Copy this bookmark:



description:


tags: