author scor <>
Fri, 14 Mar 2014 12:03:13 -0400
changeset 179 b4c3ad199322
permissions -rw-r--r--
Add example inspired from stackoverflow for QA proposal
<!DOCTYPE html>
<title>Web Schemas TF: tests: test 1 (format md)</title>
<body itemscope itemtype="">

  <!-- inspired from -->
  <div itemscope itemtype="">
    <h1 itemprop="name">What is attr_accessor in Ruby?</h1>
    <!-- Uses a new made-up property 'voteCount' because stackoverflow doesn't show up/down votes,
         see -->
    <div itemprop="voteCount">196</div>
    <!-- There is uncertainty around description vs. text, probably not something we
    should solve in this proposal though. Using text for now -->
    <div itemprop="text">I am having a hard time understanding attr_accessors in Ruby, can someone explain them to me? I have done tons of Google searches, just can't understand them fully.</div>
    <div>asked <time itemprop="dateCreated" datetime="2010-12-06T21:07Z">Dec 6 '10 at 21:07</time></div>
    <div itemprop="author" itemscope itemtype=""><span itemprop="name">dennismonsewicz</span></div>
    <div><span itemprop="answerCount">6</span> answers</div>

    <div itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="">
      <div itemprop="voteCount">542</div>
      <div itemprop="text">
        Let's say you have a class Person.
        class Person
        person = # => no method error

        Obviously we never defined method name. Let's do that.
      <div>answered <time itemprop="dateCreated" datetime="2010-12-06T22:11Z">Dec 6 '10 at 22:11</time></div>
      <div itemprop="author" itemscope itemtype=""><span itemprop="name">hakunin</span></div>

    <div itemprop="suggestedAnswer" itemscope itemtype="">
      <div itemprop="voteCount">39</div>
      <div itemprop="text">
        attr_accesssor is just a method. (The link should provide more insight with how it works - look at the pairs of methods generated, and a tutorial should show you how to use it.)
      <div>answered <time itemprop="dateCreated" datetime="2010-12-06T21:11Z">Dec 6 '10 at 21:11</time></div>
      <div itemprop="author" itemscope itemtype=""><span itemprop="name">user166390</span></div>