xbrlware-ce 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile.rb CHANGED
@@ -32,7 +32,7 @@ TESTDIR = 'test'
32
32
  EXAMPLEDIR = 'example'
33
33
 
34
34
  # Configure some constants and built-in tasks
35
- CURRENT_VERSION = '1.0.3'
35
+ CURRENT_VERSION = '1.0.4'
36
36
  PKG_VERSION = ENV['REL'] ? ENV['REL'] : CURRENT_VERSION
37
37
 
38
38
  COMMUNITY_EDITION = 'xbrlware-ce'
@@ -121,4 +121,4 @@ else
121
121
  Rake::GemPackageTask.new(spec) do |t|
122
122
  t.need_tar = true
123
123
  end
124
- end
124
+ end
@@ -81,7 +81,7 @@
81
81
  <div id="description">
82
82
  <p>
83
83
  This class defines method to <a
84
- href="HTMLFeedDownloader.html#M000079">download</a> XBRL files from
84
+ href="HTMLFeedDownloader.html#M000080">download</a> XBRL files from
85
85
  SEC&#8216;s EDGAR filling url. See <a
86
86
  href="http://code.google.com/p/xbrlware/wiki/ReportGeneration">report
87
87
  generation xbrlware wiki</a> for how to use this class.
@@ -96,7 +96,7 @@ generation xbrlware wiki</a> for how to use this class.
96
96
  <h3 class="section-bar">Methods</h3>
97
97
 
98
98
  <div class="name-list">
99
- <a href="#M000079">download</a>&nbsp;&nbsp;
99
+ <a href="#M000080">download</a>&nbsp;&nbsp;
100
100
  </div>
101
101
  </div>
102
102
 
@@ -139,11 +139,11 @@ generation xbrlware wiki</a> for how to use this class.
139
139
  <div id="methods">
140
140
  <h3 class="section-bar">Public Instance methods</h3>
141
141
 
142
- <div id="method-M000079" class="method-detail">
143
- <a name="M000079"></a>
142
+ <div id="method-M000080" class="method-detail">
143
+ <a name="M000080"></a>
144
144
 
145
145
  <div class="method-heading">
146
- <a href="#M000079" class="method-signature">
146
+ <a href="#M000080" class="method-signature">
147
147
  <span class="method-name">download</span><span class="method-args">(url, download_to=File.expand_path(&quot;.&quot;)+File::SEPARATOR)</span>
148
148
  </a>
149
149
  </div>
@@ -151,14 +151,14 @@ generation xbrlware wiki</a> for how to use this class.
151
151
  <div class="method-description">
152
152
  <p>
153
153
  Takes url and download_to (where to <a
154
- href="HTMLFeedDownloader.html#M000079">download</a>)
154
+ href="HTMLFeedDownloader.html#M000080">download</a>)
155
155
  </p>
156
156
  <pre>
157
157
  default value for download_to is current_dir
158
158
  </pre>
159
159
  <p><a class="source-toggle" href="#"
160
- onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
161
- <div class="method-source-code" id="M000079-source">
160
+ onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
161
+ <div class="method-source-code" id="M000080-source">
162
162
  <pre>
163
163
  <span class="ruby-comment cmt"># File lib/edgar/edgar_data_downloader.rb, line 92</span>
164
164
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">download</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">download_to</span>=<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">&quot;.&quot;</span>)<span class="ruby-operator">+</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>)
@@ -81,7 +81,7 @@
81
81
  <div id="description">
82
82
  <p>
83
83
  This class defines method to <a
84
- href="RSSFeedDownloader.html#M000078">download</a> XBRL files from
84
+ href="RSSFeedDownloader.html#M000079">download</a> XBRL files from
85
85
  SEC&#8216;s XBRL RSS Feed. See <a
86
86
  href="http://code.google.com/p/xbrlware/wiki/ReportGeneration">report
87
87
  generation xbrlware wiki</a> for how to use this class.
@@ -96,8 +96,8 @@ generation xbrlware wiki</a> for how to use this class.
96
96
  <h3 class="section-bar">Methods</h3>
97
97
 
98
98
  <div class="name-list">
99
- <a href="#M000078">download</a>&nbsp;&nbsp;
100
- <a href="#M000077">new</a>&nbsp;&nbsp;
99
+ <a href="#M000079">download</a>&nbsp;&nbsp;
100
+ <a href="#M000078">new</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -139,19 +139,19 @@ generation xbrlware wiki</a> for how to use this class.
139
139
  <div id="methods">
140
140
  <h3 class="section-bar">Public Class methods</h3>
141
141
 
142
- <div id="method-M000077" class="method-detail">
143
- <a name="M000077"></a>
142
+ <div id="method-M000078" class="method-detail">
143
+ <a name="M000078"></a>
144
144
 
145
145
  <div class="method-heading">
146
- <a href="#M000077" class="method-signature">
146
+ <a href="#M000078" class="method-signature">
147
147
  <span class="method-name">new</span><span class="method-args">(sec_edgar_rss_file=nil)</span>
148
148
  </a>
149
149
  </div>
150
150
 
151
151
  <div class="method-description">
152
152
  <p><a class="source-toggle" href="#"
153
- onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
154
- <div class="method-source-code" id="M000077-source">
153
+ onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
154
+ <div class="method-source-code" id="M000078-source">
155
155
  <pre>
156
156
  <span class="ruby-comment cmt"># File lib/edgar/edgar_data_downloader.rb, line 29</span>
157
157
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">sec_edgar_rss_file</span>=<span class="ruby-keyword kw">nil</span>)
@@ -165,11 +165,11 @@ generation xbrlware wiki</a> for how to use this class.
165
165
 
166
166
  <h3 class="section-bar">Public Instance methods</h3>
167
167
 
168
- <div id="method-M000078" class="method-detail">
169
- <a name="M000078"></a>
168
+ <div id="method-M000079" class="method-detail">
169
+ <a name="M000079"></a>
170
170
 
171
171
  <div class="method-heading">
172
- <a href="#M000078" class="method-signature">
172
+ <a href="#M000079" class="method-signature">
173
173
  <span class="method-name">download</span><span class="method-args">(limit=100, download_to=File.expand_path(&quot;.&quot;)+File::SEPARATOR+&quot;edgar_data&quot;)</span>
174
174
  </a>
175
175
  </div>
@@ -177,16 +177,16 @@ generation xbrlware wiki</a> for how to use this class.
177
177
  <div class="method-description">
178
178
  <p>
179
179
  Takes limit (how many entities to <a
180
- href="RSSFeedDownloader.html#M000078">download</a>), download_to (where to
181
- <a href="RSSFeedDownloader.html#M000078">download</a>)
180
+ href="RSSFeedDownloader.html#M000079">download</a>), download_to (where to
181
+ <a href="RSSFeedDownloader.html#M000079">download</a>)
182
182
  </p>
183
183
  <pre>
184
184
  default value for limit is 100
185
185
  default value for download_to is current_dir + &quot;/edgar_data&quot;
186
186
  </pre>
187
187
  <p><a class="source-toggle" href="#"
188
- onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
189
- <div class="method-source-code" id="M000078-source">
188
+ onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
189
+ <div class="method-source-code" id="M000079-source">
190
190
  <pre>
191
191
  <span class="ruby-comment cmt"># File lib/edgar/edgar_data_downloader.rb, line 37</span>
192
192
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">download</span>(<span class="ruby-identifier">limit</span>=<span class="ruby-value">100</span>, <span class="ruby-identifier">download_to</span>=<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">&quot;.&quot;</span>)<span class="ruby-operator">+</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span><span class="ruby-operator">+</span><span class="ruby-value str">&quot;edgar_data&quot;</span>)
@@ -96,15 +96,16 @@ instance page on xbrlware wiki</a> for more details.
96
96
 
97
97
  <div class="name-list">
98
98
  <a href="#M000066">context</a>&nbsp;&nbsp;
99
- <a href="#M000073">context_for_item</a>&nbsp;&nbsp;
99
+ <a href="#M000074">context_for_item</a>&nbsp;&nbsp;
100
100
  <a href="#M000067">ctx_groupby_dim</a>&nbsp;&nbsp;
101
101
  <a href="#M000070">ctx_groupby_dim_dom_print</a>&nbsp;&nbsp;
102
102
  <a href="#M000068">ctx_groupby_dom</a>&nbsp;&nbsp;
103
103
  <a href="#M000069">ctx_groupby_period</a>&nbsp;&nbsp;
104
- <a href="#M000076">entity_details</a>&nbsp;&nbsp;
105
- <a href="#M000075">footnotes</a>&nbsp;&nbsp;
106
- <a href="#M000072">item</a>&nbsp;&nbsp;
107
- <a href="#M000074">item_ctx_filter</a>&nbsp;&nbsp;
104
+ <a href="#M000077">entity_details</a>&nbsp;&nbsp;
105
+ <a href="#M000076">footnotes</a>&nbsp;&nbsp;
106
+ <a href="#M000073">item</a>&nbsp;&nbsp;
107
+ <a href="#M000072">item_all_map</a>&nbsp;&nbsp;
108
+ <a href="#M000075">item_ctx_filter</a>&nbsp;&nbsp;
108
109
  <a href="#M000063">new</a>&nbsp;&nbsp;
109
110
  <a href="#M000064">raw</a>&nbsp;&nbsp;
110
111
  <a href="#M000065">schema_ref</a>&nbsp;&nbsp;
@@ -253,28 +254,28 @@ Takes optional context_id as string and dimensions as array
253
254
  </div>
254
255
  </div>
255
256
 
256
- <div id="method-M000073" class="method-detail">
257
- <a name="M000073"></a>
257
+ <div id="method-M000074" class="method-detail">
258
+ <a name="M000074"></a>
258
259
 
259
260
  <div class="method-heading">
260
- <a href="#M000073" class="method-signature">
261
+ <a href="#M000074" class="method-signature">
261
262
  <span class="method-name">context_for_item</span><span class="method-args">(item_name)</span>
262
263
  </a>
263
264
  </div>
264
265
 
265
266
  <div class="method-description">
266
267
  <p>
267
- Takes <a href="Instance.html#M000072">item</a> name
268
+ Takes <a href="Instance.html#M000073">item</a> name
268
269
  </p>
269
270
  <pre>
270
271
  Returns array of contexts for given item name
271
272
  Returns empty array if no item with given name found
272
273
  </pre>
273
274
  <p><a class="source-toggle" href="#"
274
- onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
275
- <div class="method-source-code" id="M000073-source">
275
+ onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
276
+ <div class="method-source-code" id="M000074-source">
276
277
  <pre>
277
- <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 291</span>
278
+ <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 312</span>
278
279
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">context_for_item</span>(<span class="ruby-identifier">item_name</span>)
279
280
  <span class="ruby-identifier">contexts</span>=[]
280
281
  <span class="ruby-identifier">items</span> = <span class="ruby-identifier">item</span>(<span class="ruby-identifier">item_name</span>)
@@ -434,21 +435,21 @@ Takes optional dimensions as array
434
435
  </div>
435
436
  </div>
436
437
 
437
- <div id="method-M000076" class="method-detail">
438
- <a name="M000076"></a>
438
+ <div id="method-M000077" class="method-detail">
439
+ <a name="M000077"></a>
439
440
 
440
441
  <div class="method-heading">
441
- <a href="#M000076" class="method-signature">
442
+ <a href="#M000077" class="method-signature">
442
443
  <span class="method-name">entity_details</span><span class="method-args">()</span>
443
444
  </a>
444
445
  </div>
445
446
 
446
447
  <div class="method-description">
447
448
  <p><a class="source-toggle" href="#"
448
- onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
449
- <div class="method-source-code" id="M000076-source">
449
+ onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
450
+ <div class="method-source-code" id="M000077-source">
450
451
  <pre>
451
- <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 331</span>
452
+ <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 352</span>
452
453
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entity_details</span>
453
454
  <span class="ruby-ivar">@entity_details</span>={}
454
455
  <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@entity_details</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>
@@ -473,7 +474,7 @@ Takes optional dimensions as array
473
474
  <span class="ruby-identifier">file_name</span>=<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-ivar">@file_name</span>)
474
475
  <span class="ruby-identifier">symbol</span>=<span class="ruby-identifier">file_name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;-&quot;</span>)[<span class="ruby-value">0</span>]
475
476
  <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">upcase!</span>
476
-
477
+
477
478
  <span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">&quot;symbol&quot;</span>]=<span class="ruby-identifier">symbol</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">nil?</span>
478
479
 
479
480
  <span class="ruby-keyword kw">end</span>
@@ -484,18 +485,18 @@ Takes optional dimensions as array
484
485
  </div>
485
486
  </div>
486
487
 
487
- <div id="method-M000075" class="method-detail">
488
- <a name="M000075"></a>
488
+ <div id="method-M000076" class="method-detail">
489
+ <a name="M000076"></a>
489
490
 
490
491
  <div class="method-heading">
491
- <a href="#M000075" class="method-signature">
492
+ <a href="#M000076" class="method-signature">
492
493
  <span class="method-name">footnotes</span><span class="method-args">(item_id=nil, lang=nil)</span>
493
494
  </a>
494
495
  </div>
495
496
 
496
497
  <div class="method-description">
497
498
  <p>
498
- Takes optional <a href="Instance.html#M000072">item</a> id and language
499
+ Takes optional <a href="Instance.html#M000073">item</a> id and language
499
500
  </p>
500
501
  <pre>
501
502
  Every item in XBRL instance file may contain optional id element.
@@ -506,10 +507,10 @@ Takes optional <a href="Instance.html#M000072">item</a> id and language
506
507
  Returns nil if no match found for item_it or footnotes not exist
507
508
  </pre>
508
509
  <p><a class="source-toggle" href="#"
509
- onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
510
- <div class="method-source-code" id="M000075-source">
510
+ onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
511
+ <div class="method-source-code" id="M000076-source">
511
512
  <pre>
512
- <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 320</span>
513
+ <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 341</span>
513
514
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">footnotes</span> (<span class="ruby-identifier">item_id</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">lang</span>=<span class="ruby-keyword kw">nil</span>)
514
515
  <span class="ruby-ivar">@item_footnote_map</span>=<span class="ruby-keyword kw">nil</span>
515
516
  <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot; lang can't be passed when item id is nil&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">nil?</span>)
@@ -524,11 +525,11 @@ Takes optional <a href="Instance.html#M000072">item</a> id and language
524
525
  </div>
525
526
  </div>
526
527
 
527
- <div id="method-M000072" class="method-detail">
528
- <a name="M000072"></a>
528
+ <div id="method-M000073" class="method-detail">
529
+ <a name="M000073"></a>
529
530
 
530
531
  <div class="method-heading">
531
- <a href="#M000072" class="method-signature">
532
+ <a href="#M000073" class="method-signature">
532
533
  <span class="method-name">item</span><span class="method-args">(name, context_ref=nil, unit_ref=nil)</span>
533
534
  </a>
534
535
  </div>
@@ -542,10 +543,10 @@ Takes name and optional context_ref and unit_ref
542
543
  Returns empty array if item is not found
543
544
  </pre>
544
545
  <p><a class="source-toggle" href="#"
545
- onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
546
- <div class="method-source-code" id="M000072-source">
546
+ onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
547
+ <div class="method-source-code" id="M000073-source">
547
548
  <pre>
548
- <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 258</span>
549
+ <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 290</span>
549
550
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">item</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">context_ref</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">unit_ref</span>=<span class="ruby-keyword kw">nil</span>)
550
551
 
551
552
  <span class="ruby-identifier">item_content</span> = <span class="ruby-ivar">@xbrl_content</span>[<span class="ruby-identifier">name</span>]
@@ -559,49 +560,71 @@ Takes name and optional context_ref and unit_ref
559
560
  <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">context_ref</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">context_ref</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;contextRef&quot;</span>]
560
561
  <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">unit_ref</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">unit_ref</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;unitRef&quot;</span>]
561
562
 
562
- <span class="ruby-identifier">context</span> = <span class="ruby-identifier">context</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;contextRef&quot;</span>])
563
- <span class="ruby-identifier">value</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;content&quot;</span>]
563
+ <span class="ruby-identifier">item</span> = <span class="ruby-identifier">to_item_obj</span>(<span class="ruby-identifier">item</span>, <span class="ruby-identifier">name</span>)
564
+ <span class="ruby-identifier">items</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span>
565
+ <span class="ruby-keyword kw">end</span>
566
+ <span class="ruby-identifier">items</span>
567
+ <span class="ruby-keyword kw">end</span>
568
+ </pre>
569
+ </div>
570
+ </div>
571
+ </div>
564
572
 
565
- <span class="ruby-identifier">unit</span>, <span class="ruby-identifier">precision</span>, <span class="ruby-identifier">decimals</span>, <span class="ruby-identifier">_footnotes</span>=<span class="ruby-keyword kw">nil</span>
573
+ <div id="method-M000072" class="method-detail">
574
+ <a name="M000072"></a>
575
+
576
+ <div class="method-heading">
577
+ <a href="#M000072" class="method-signature">
578
+ <span class="method-name">item_all_map</span><span class="method-args">()</span>
579
+ </a>
580
+ </div>
581
+
582
+ <div class="method-description">
583
+ <p><a class="source-toggle" href="#"
584
+ onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
585
+ <div class="method-source-code" id="M000072-source">
586
+ <pre>
587
+ <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 273</span>
588
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">item_all_map</span>
589
+ <span class="ruby-identifier">all_items</span> = <span class="ruby-ivar">@xbrl_content</span>
590
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">all_items</span>.<span class="ruby-identifier">nil?</span>
566
591
 
567
- <span class="ruby-identifier">unit</span> = <span class="ruby-identifier">unit</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;unitRef&quot;</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;unitRef&quot;</span>].<span class="ruby-identifier">nil?</span>
568
- <span class="ruby-identifier">precision</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;precision&quot;</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;precision&quot;</span>].<span class="ruby-identifier">nil?</span>
569
- <span class="ruby-identifier">decimals</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;decimals&quot;</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;decimals&quot;</span>].<span class="ruby-identifier">nil?</span>
592
+ <span class="ruby-identifier">items_hash</span>={}
570
593
 
571
- <span class="ruby-identifier">_footnotes</span> = <span class="ruby-identifier">footnotes</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;id&quot;</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">&quot;id&quot;</span>].<span class="ruby-identifier">nil?</span>
572
- <span class="ruby-identifier">item</span>=<span class="ruby-constant">Item</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">context</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">unit</span>, <span class="ruby-identifier">precision</span>, <span class="ruby-identifier">decimals</span>, <span class="ruby-identifier">_footnotes</span>)
573
- <span class="ruby-identifier">item</span>.<span class="ruby-identifier">def</span>=<span class="ruby-ivar">@taxonomy</span>.<span class="ruby-identifier">definition</span>(<span class="ruby-identifier">name</span>)
574
- <span class="ruby-identifier">items</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span>
594
+ <span class="ruby-identifier">all_items</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">item_content</span><span class="ruby-operator">|</span>
595
+ <span class="ruby-identifier">_name</span>=<span class="ruby-identifier">name</span>.<span class="ruby-identifier">upcase</span>
596
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">_name</span><span class="ruby-operator">==</span><span class="ruby-value str">&quot;CONTEXT&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">_name</span><span class="ruby-operator">==</span><span class="ruby-value str">&quot;UNIT&quot;</span>
597
+ <span class="ruby-identifier">items_hash</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">upcase</span>] = <span class="ruby-identifier">item</span>(<span class="ruby-identifier">name</span>)
575
598
  <span class="ruby-keyword kw">end</span>
576
- <span class="ruby-identifier">items</span>
599
+ <span class="ruby-identifier">items_hash</span>
577
600
  <span class="ruby-keyword kw">end</span>
578
601
  </pre>
579
602
  </div>
580
603
  </div>
581
604
  </div>
582
605
 
583
- <div id="method-M000074" class="method-detail">
584
- <a name="M000074"></a>
606
+ <div id="method-M000075" class="method-detail">
607
+ <a name="M000075"></a>
585
608
 
586
609
  <div class="method-heading">
587
- <a href="#M000074" class="method-signature">
610
+ <a href="#M000075" class="method-signature">
588
611
  <span class="method-name">item_ctx_filter</span><span class="method-args">(name) {|item.context| ...}</span>
589
612
  </a>
590
613
  </div>
591
614
 
592
615
  <div class="method-description">
593
616
  <p>
594
- Takes <a href="Instance.html#M000072">item</a> name and filter block
617
+ Takes <a href="Instance.html#M000073">item</a> name and filter block
595
618
  </p>
596
619
  <pre>
597
620
  Fetches item with name and invokes filter block with item context
598
621
  Returns matched items.
599
622
  </pre>
600
623
  <p><a class="source-toggle" href="#"
601
- onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
602
- <div class="method-source-code" id="M000074-source">
624
+ onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
625
+ <div class="method-source-code" id="M000075-source">
603
626
  <pre>
604
- <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 302</span>
627
+ <span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 323</span>
605
628
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">item_ctx_filter</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">context_filter_block</span>)
606
629
  <span class="ruby-identifier">items</span>=<span class="ruby-identifier">item</span>(<span class="ruby-identifier">name</span>)
607
630
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">items</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">context_filter_block</span>.<span class="ruby-identifier">nil?</span>
data/doc/created.rid CHANGED
@@ -1 +1 @@
1
- Tue, 12 Jan 2010 15:09:36 +0530
1
+ Thu, 28 Jan 2010 19:57:46 +0530
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Dec 10 18:12:12 +0530 2009</td>
59
+ <td>Wed Jan 13 10:02:24 +0530 2010</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Jan 10 11:06:58 +0530 2010</td>
59
+ <td>Thu Jan 28 19:39:54 +0530 2010</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -24,7 +24,7 @@
24
24
  <a href="classes/Xbrlware/Linkbase/CalculationLinkbase.html#M000021">calculation (Xbrlware::Linkbase::CalculationLinkbase)</a><br />
25
25
  <a href="classes/Xbrlware/Taxonomy.html#M000059">callb (Xbrlware::Taxonomy)</a><br />
26
26
  <a href="classes/Xbrlware/Instance.html#M000066">context (Xbrlware::Instance)</a><br />
27
- <a href="classes/Xbrlware/Instance.html#M000073">context_for_item (Xbrlware::Instance)</a><br />
27
+ <a href="classes/Xbrlware/Instance.html#M000074">context_for_item (Xbrlware::Instance)</a><br />
28
28
  <a href="classes/Xbrlware/Instance.html#M000067">ctx_groupby_dim (Xbrlware::Instance)</a><br />
29
29
  <a href="classes/Xbrlware/Instance.html#M000070">ctx_groupby_dim_dom_print (Xbrlware::Instance)</a><br />
30
30
  <a href="classes/Xbrlware/Instance.html#M000068">ctx_groupby_dom (Xbrlware::Instance)</a><br />
@@ -36,9 +36,9 @@
36
36
  <a href="classes/Xbrlware/Context.html#M000038">dimensions (Xbrlware::Context)</a><br />
37
37
  <a href="classes/Xbrlware/Context.html#M000042">dimensions_domains (Xbrlware::Context)</a><br />
38
38
  <a href="classes/Xbrlware/Context.html#M000040">domains (Xbrlware::Context)</a><br />
39
- <a href="classes/Edgar/RSSFeedDownloader.html#M000078">download (Edgar::RSSFeedDownloader)</a><br />
40
- <a href="classes/Edgar/HTMLFeedDownloader.html#M000079">download (Edgar::HTMLFeedDownloader)</a><br />
41
- <a href="classes/Xbrlware/Instance.html#M000076">entity_details (Xbrlware::Instance)</a><br />
39
+ <a href="classes/Edgar/RSSFeedDownloader.html#M000079">download (Edgar::RSSFeedDownloader)</a><br />
40
+ <a href="classes/Edgar/HTMLFeedDownloader.html#M000080">download (Edgar::HTMLFeedDownloader)</a><br />
41
+ <a href="classes/Xbrlware/Instance.html#M000077">entity_details (Xbrlware::Instance)</a><br />
42
42
  <a href="classes/Xbrlware/Context.html#M000033">eql? (Xbrlware::Context)</a><br />
43
43
  <a href="classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html#M000009">eql? (Xbrlware::Linkbase::Linkbase::Link::Arc)</a><br />
44
44
  <a href="classes/Xbrlware/Context.html#M000037">explicit_dimensions (Xbrlware::Context)</a><br />
@@ -48,53 +48,54 @@
48
48
  <a href="classes/Xbrlware/Entity.html#M000047">explicit_domains (Xbrlware::Entity)</a><br />
49
49
  <a href="classes/Xbrlware/Context.html#M000039">explicit_domains (Xbrlware::Context)</a><br />
50
50
  <a href="classes/Xbrlware.html#M000002">file_grep (Xbrlware)</a><br />
51
- <a href="classes/Xbrlware/Instance.html#M000075">footnotes (Xbrlware::Instance)</a><br />
51
+ <a href="classes/Xbrlware/Instance.html#M000076">footnotes (Xbrlware::Instance)</a><br />
52
52
  <a href="classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html#M000008">has_children? (Xbrlware::Linkbase::Linkbase::Link::Arc)</a><br />
53
- <a href="classes/Xbrlware/Context.html#M000036">has_dimensions? (Xbrlware::Context)</a><br />
54
53
  <a href="classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation.html#M000014">has_dimensions? (Xbrlware::Linkbase::PresentationLinkbase::Presentation)</a><br />
55
- <a href="classes/Xbrlware/Context.html#M000035">has_explicit_dimensions? (Xbrlware::Context)</a><br />
54
+ <a href="classes/Xbrlware/Context.html#M000036">has_dimensions? (Xbrlware::Context)</a><br />
56
55
  <a href="classes/Xbrlware/Entity.html#M000045">has_explicit_dimensions? (Xbrlware::Entity)</a><br />
56
+ <a href="classes/Xbrlware/Context.html#M000035">has_explicit_dimensions? (Xbrlware::Context)</a><br />
57
57
  <a href="classes/Xbrlware/Context.html#M000034">hash (Xbrlware::Context)</a><br />
58
58
  <a href="classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html#M000010">hash (Xbrlware::Linkbase::Linkbase::Link::Arc)</a><br />
59
59
  <a href="classes/Xbrlware/Taxonomy.html#M000060">init_all_lb (Xbrlware::Taxonomy)</a><br />
60
60
  <a href="classes/Xbrlware.html#M000003">ins (Xbrlware)</a><br />
61
61
  <a href="classes/Xbrlware/Linkbase/LabelLinkbase.html#M000018">inspect (Xbrlware::Linkbase::LabelLinkbase)</a><br />
62
62
  <a href="classes/Xbrlware/Linkbase/Linkbase/Link.html#M000006">inspect (Xbrlware::Linkbase::Linkbase::Link)</a><br />
63
- <a href="classes/Xbrlware/Instance.html#M000072">item (Xbrlware::Instance)</a><br />
64
- <a href="classes/Xbrlware/Instance.html#M000074">item_ctx_filter (Xbrlware::Instance)</a><br />
63
+ <a href="classes/Xbrlware/Instance.html#M000073">item (Xbrlware::Instance)</a><br />
64
+ <a href="classes/Xbrlware/Instance.html#M000072">item_all_map (Xbrlware::Instance)</a><br />
65
+ <a href="classes/Xbrlware/Instance.html#M000075">item_ctx_filter (Xbrlware::Instance)</a><br />
65
66
  <a href="classes/Xbrlware/Linkbase/LabelLinkbase.html#M000017">label (Xbrlware::Linkbase::LabelLinkbase)</a><br />
66
67
  <a href="classes/Xbrlware/Taxonomy.html#M000056">lablb (Xbrlware::Taxonomy)</a><br />
67
68
  <a href="classes/Xbrlware/TaxonomyDefintion.html#M000030">method_missing (Xbrlware::TaxonomyDefintion)</a><br />
68
- <a href="classes/Edgar/RSSFeedDownloader.html#M000077">new (Edgar::RSSFeedDownloader)</a><br />
69
- <a href="classes/Xbrlware/Entity.html#M000043">new (Xbrlware::Entity)</a><br />
70
- <a href="classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation.html#M000013">new (Xbrlware::Linkbase::PresentationLinkbase::Presentation)</a><br />
71
- <a href="classes/Xbrlware/Linkbase/Linkbase/Link.html#M000005">new (Xbrlware::Linkbase::Linkbase::Link)</a><br />
72
69
  <a href="classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation/PresentationArc.html#M000015">new (Xbrlware::Linkbase::PresentationLinkbase::Presentation::PresentationArc)</a><br />
73
- <a href="classes/Xbrlware/Context.html#M000031">new (Xbrlware::Context)</a><br />
70
+ <a href="classes/Xbrlware/Linkbase/LabelLinkbase.html#M000016">new (Xbrlware::Linkbase::LabelLinkbase)</a><br />
71
+ <a href="classes/Xbrlware/Item.html#M000049">new (Xbrlware::Item)</a><br />
72
+ <a href="classes/Edgar/RSSFeedDownloader.html#M000078">new (Edgar::RSSFeedDownloader)</a><br />
73
+ <a href="classes/Xbrlware/Entity.html#M000043">new (Xbrlware::Entity)</a><br />
74
74
  <a href="classes/Xbrlware/Unit.html#M000052">new (Xbrlware::Unit)</a><br />
75
- <a href="classes/Xbrlware/Unit/Divide.html#M000053">new (Xbrlware::Unit::Divide)</a><br />
75
+ <a href="classes/Xbrlware/Linkbase/Linkbase/Link.html#M000005">new (Xbrlware::Linkbase::Linkbase::Link)</a><br />
76
76
  <a href="classes/Xbrlware/Taxonomy.html#M000054">new (Xbrlware::Taxonomy)</a><br />
77
+ <a href="classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation.html#M000013">new (Xbrlware::Linkbase::PresentationLinkbase::Presentation)</a><br />
78
+ <a href="classes/Xbrlware/Linkbase/LabelLinkbase/Label.html#M000019">new (Xbrlware::Linkbase::LabelLinkbase::Label)</a><br />
79
+ <a href="classes/Xbrlware/Linkbase/CalculationLinkbase.html#M000020">new (Xbrlware::Linkbase::CalculationLinkbase)</a><br />
80
+ <a href="classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation.html#M000022">new (Xbrlware::Linkbase::CalculationLinkbase::Calculation)</a><br />
77
81
  <a href="classes/Xbrlware/Linkbase/PresentationLinkbase.html#M000011">new (Xbrlware::Linkbase::PresentationLinkbase)</a><br />
82
+ <a href="classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation/CalculationArc.html#M000023">new (Xbrlware::Linkbase::CalculationLinkbase::Calculation::CalculationArc)</a><br />
83
+ <a href="classes/Xbrlware/Identifier.html#M000061">new (Xbrlware::Identifier)</a><br />
84
+ <a href="classes/Xbrlware/Linkbase/Linkbase.html#M000004">new (Xbrlware::Linkbase::Linkbase)</a><br />
85
+ <a href="classes/Xbrlware/Instance.html#M000063">new (Xbrlware::Instance)</a><br />
86
+ <a href="classes/Xbrlware/Context.html#M000031">new (Xbrlware::Context)</a><br />
78
87
  <a href="classes/Xbrlware/TaxonomyDefintion.html#M000029">new (Xbrlware::TaxonomyDefintion)</a><br />
79
88
  <a href="classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition/DefinitionArc.html#M000028">new (Xbrlware::Linkbase::DefinitionLinkbase::Definition::DefinitionArc)</a><br />
80
- <a href="classes/Xbrlware/Linkbase/LabelLinkbase.html#M000016">new (Xbrlware::Linkbase::LabelLinkbase)</a><br />
81
- <a href="classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition.html#M000026">new (Xbrlware::Linkbase::DefinitionLinkbase::Definition)</a><br />
82
89
  <a href="classes/Xbrlware/Linkbase/DefinitionLinkbase.html#M000024">new (Xbrlware::Linkbase::DefinitionLinkbase)</a><br />
83
- <a href="classes/Xbrlware/Identifier.html#M000061">new (Xbrlware::Identifier)</a><br />
84
- <a href="classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation/CalculationArc.html#M000023">new (Xbrlware::Linkbase::CalculationLinkbase::Calculation::CalculationArc)</a><br />
85
- <a href="classes/Xbrlware/Instance.html#M000063">new (Xbrlware::Instance)</a><br />
86
- <a href="classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation.html#M000022">new (Xbrlware::Linkbase::CalculationLinkbase::Calculation)</a><br />
87
- <a href="classes/Xbrlware/Linkbase/Linkbase.html#M000004">new (Xbrlware::Linkbase::Linkbase)</a><br />
88
- <a href="classes/Xbrlware/Linkbase/CalculationLinkbase.html#M000020">new (Xbrlware::Linkbase::CalculationLinkbase)</a><br />
89
90
  <a href="classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html#M000007">new (Xbrlware::Linkbase::Linkbase::Link::Arc)</a><br />
90
- <a href="classes/Xbrlware/Linkbase/LabelLinkbase/Label.html#M000019">new (Xbrlware::Linkbase::LabelLinkbase::Label)</a><br />
91
- <a href="classes/Xbrlware/Item.html#M000049">new (Xbrlware::Item)</a><br />
91
+ <a href="classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition.html#M000026">new (Xbrlware::Linkbase::DefinitionLinkbase::Definition)</a><br />
92
+ <a href="classes/Xbrlware/Unit/Divide.html#M000053">new (Xbrlware::Unit::Divide)</a><br />
92
93
  <a href="classes/Xbrlware/Taxonomy.html#M000058">prelb (Xbrlware::Taxonomy)</a><br />
93
94
  <a href="classes/Xbrlware/Linkbase/PresentationLinkbase.html#M000012">presentation (Xbrlware::Linkbase::PresentationLinkbase)</a><br />
94
95
  <a href="classes/Xbrlware/Instance.html#M000064">raw (Xbrlware::Instance)</a><br />
95
96
  <a href="classes/Xbrlware/Instance.html#M000065">schema_ref (Xbrlware::Instance)</a><br />
96
- <a href="classes/Xbrlware/Entity.html#M000044">to_s (Xbrlware::Entity)</a><br />
97
97
  <a href="classes/Xbrlware/Identifier.html#M000062">to_s (Xbrlware::Identifier)</a><br />
98
+ <a href="classes/Xbrlware/Entity.html#M000044">to_s (Xbrlware::Entity)</a><br />
98
99
  <a href="classes/Xbrlware/Context.html#M000032">to_s (Xbrlware::Context)</a><br />
99
100
  <a href="classes/CGI.html#M000001">unescapeHTML (CGI)</a><br />
100
101
  <a href="classes/Xbrlware/Instance.html#M000071">unit (Xbrlware::Instance)</a><br />
@@ -252,6 +252,38 @@ module Xbrlware
252
252
  units
253
253
  end
254
254
 
255
+ private
256
+ def to_item_obj(item, name)
257
+ context, unit, precision, decimals, _footnotes=nil
258
+
259
+ context = context(item["contextRef"]) unless item["contextRef"].nil?
260
+ value = item["content"]
261
+
262
+ unit = unit(item["unitRef"]) unless item["unitRef"].nil?
263
+ precision = item["precision"] unless item["precision"].nil?
264
+ decimals = item["decimals"] unless item["decimals"].nil?
265
+
266
+ _footnotes = footnotes(item["id"]) unless item["id"].nil?
267
+ item=Item.new(name, context, value, unit, precision, decimals, _footnotes)
268
+ item.def=@taxonomy.definition(name)
269
+ return item
270
+ end
271
+
272
+ public
273
+ def item_all_map
274
+ all_items = @xbrl_content
275
+ return nil if all_items.nil?
276
+
277
+ items_hash={}
278
+
279
+ all_items.each do |name, item_content|
280
+ _name=name.upcase
281
+ next if _name=="CONTEXT" || _name=="UNIT"
282
+ items_hash[name.upcase] = item(name)
283
+ end
284
+ items_hash
285
+ end
286
+
255
287
  # Takes name and optional context_ref and unit_ref
256
288
  # Returns array of Item for given name, context_ref and unit_ref
257
289
  # Returns empty array if item is not found
@@ -268,18 +300,7 @@ module Xbrlware
268
300
  next unless context_ref.nil? || context_ref == item["contextRef"]
269
301
  next unless unit_ref.nil? || unit_ref == item["unitRef"]
270
302
 
271
- context = context(item["contextRef"])
272
- value = item["content"]
273
-
274
- unit, precision, decimals, _footnotes=nil
275
-
276
- unit = unit(item["unitRef"]) unless item["unitRef"].nil?
277
- precision = item["precision"] unless item["precision"].nil?
278
- decimals = item["decimals"] unless item["decimals"].nil?
279
-
280
- _footnotes = footnotes(item["id"]) unless item["id"].nil?
281
- item=Item.new(name, context, value, unit, precision, decimals, _footnotes)
282
- item.def=@taxonomy.definition(name)
303
+ item = to_item_obj(item, name)
283
304
  items << item
284
305
  end
285
306
  items
@@ -352,7 +373,7 @@ module Xbrlware
352
373
  file_name=File.basename(@file_name)
353
374
  symbol=file_name.split("-")[0]
354
375
  symbol.upcase!
355
-
376
+
356
377
  @entity_details["symbol"]=symbol unless symbol.nil?
357
378
 
358
379
  end
data/xbrlware.iml CHANGED
@@ -5,15 +5,15 @@
5
5
  <requirement>
6
6
  <dependency name="rake" version="0" bound="GREATER_OR_EQUAL" />
7
7
  </requirement>
8
- <source from="pkg/xbrlware-ce-1.0.2/Rakefile.rb" />
9
8
  <source from="Rakefile.rb" />
9
+ <source from="pkg/xbrlware-ce-1.0.3/Rakefile.rb" />
10
10
  </requirement>
11
11
  <requirement>
12
12
  <requirement>
13
13
  <dependency name="xml-simple" version="1.0.12" bound="EQUAL" />
14
14
  </requirement>
15
15
  <source from="lib/xbrlware.rb" />
16
- <source from="pkg/xbrlware-ce-1.0.2/lib/xbrlware.rb" />
16
+ <source from="pkg/xbrlware-ce-1.0.3/lib/xbrlware.rb" />
17
17
  </requirement>
18
18
  </component>
19
19
  <component name="NewModuleRootManager" inherit-compiler-output="true">
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xbrlware-ce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bitstat technologies
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-12 00:00:00 +05:30
12
+ date: 2010-01-28 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency