Subversion Info

Rev
437
Last Checked In
2008-03-28 00:49:20 (2 weeks ago)
Checked in by
deveiant

Methods

Class Index

Quicksearch

Arrow::TestDataSource

Locally-stored mock data source class to be used for testing purposes.

Constants

SVNRev
SVN Revision
SVNId
SVN Id

Attributes

real_source[R]

(Not documented)

Public Class Methods

new( uri, source ) click to toggle source

Creates a new TestData object with the given identifier, and either loads the pre-existing data from disk, or creates it.

    # File /Users/ged/source/ruby/Arrow/lib/arrow/data-source/test.rb, line 55
55:     def initialize( uri, source )
56:         @source = source + "/" + name
57:     end

Public Instance Methods

save() click to toggle source

Saves the test data to the data directory.

    # File /Users/ged/source/ruby/Arrow/lib/arrow/data-source/test.rb, line 65
65:     def save 
66:         name = File.join(TestData.data_path,@source)
67:         File.new(name, "w") {|file|
68:             file.write(@data.to_yaml)
69:         }
70:     end

secsequence

--- SEC00041

seccomment

--- ""

attributes

--- 
- name: real_source
  rw: R
  a_desc: ""

method_list

--- 
- methods: 
  - visibility: public
    aref: M000384
    name: new
    sourcecode: "    <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/data-source/test.rb, line 55</span>\n\
      55:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">uri</span>, <span class=\"ruby-identifier\">source</span> )\n\
      56:         <span class=\"ruby-ivar\">@source</span> = <span class=\"ruby-identifier\">source</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">&quot;/&quot;</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">name</span>\n\
      57:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Creates a <a href="TestDataSource.html#M000384">new</a> TestData object
      with the given identifier, and either loads the pre-existing data from
      disk, or creates it.
      </p>
    params: ( uri, source )
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000385
    name: save
    sourcecode: "    <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/data-source/test.rb, line 65</span>\n\
      65:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">save</span> \n\
      66:         <span class=\"ruby-identifier\">name</span> = <span class=\"ruby-constant\">File</span>.<span class=\"ruby-identifier\">join</span>(<span class=\"ruby-constant\">TestData</span>.<span class=\"ruby-identifier\">data_path</span>,<span class=\"ruby-ivar\">@source</span>)\n\
      67:         <span class=\"ruby-constant\">File</span>.<span class=\"ruby-identifier\">new</span>(<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-value str\">&quot;w&quot;</span>) {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">file</span><span class=\"ruby-operator\">|</span>\n\
      68:             <span class=\"ruby-identifier\">file</span>.<span class=\"ruby-identifier\">write</span>(<span class=\"ruby-ivar\">@data</span>.<span class=\"ruby-identifier\">to_yaml</span>)\n\
      69:         }\n\
      70:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Saves the test data to the data directory.
      </p>
    params: ()
  category: Instance
  type: Public

sectitle

--- 

constants

--- 
- name: SVNRev
  desc: |+
    
    SVN Revision
    
  value: "%q$Rev: 437 $"
- name: SVNId
  desc: |+
    
    SVN Id
    
  value: "%q$Id: test.rb 437 2008-03-28 00:49:20Z deveiant $"

[Validate]

Generated with the Darkfish Rdoc Generator.