Sha256: a5e8a3461433d1f25981538363e0066bae86f3e2651daa78c8c8f3f8b4e72b38
Contents?: true
Size: 771 Bytes
Versions: 2
Compression:
Stored size: 771 Bytes
Contents
--- !ruby/object:RI::MethodDescription aliases: [] block_params: self comment: - !ruby/struct:SM::Flow::P body: "Allows the initialization of an OpenStruct with a block:" - !ruby/struct:SM::Flow::VERB body: " person = OpenStruct.new do |p|\n p.name = 'John Smith'\n p.gender = :M\n p.age = 71\n end\n" - !ruby/struct:SM::Flow::P body: You can still provide a hash for initialization purposes, and even combine the two approaches if you wish. - !ruby/struct:SM::Flow::VERB body: " person = OpenStruct.new(:name => 'John Smith', :age => 31) do |p|\n p.gender = :M\n end\n\n CREDIT Noah Gibbs\n CREDIT Gavin Sinclair\n" full_name: OpenStruct::new is_singleton: true name: new params: (hash=nil) {|self| ...} visibility: public
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
facets-2.4.3 | doc/ri/OpenStruct/new-c.yaml |
facets-2.4.2 | doc/ri/OpenStruct/new-c.yaml |