xbrlware-ce 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Copying.txt +13 -0
- data/License.txt +13 -0
- data/Rakefile.rb +124 -0
- data/Readme.txt +15 -0
- data/doc/classes/Edgar.html +144 -0
- data/doc/classes/Edgar/HTMLFeedDownloader.html +199 -0
- data/doc/classes/Edgar/RSSFeedDownloader.html +225 -0
- data/doc/classes/Xbrlware.html +350 -0
- data/doc/classes/Xbrlware/Context.html +429 -0
- data/doc/classes/Xbrlware/Entity.html +323 -0
- data/doc/classes/Xbrlware/Identifier.html +191 -0
- data/doc/classes/Xbrlware/Instance.html +742 -0
- data/doc/classes/Xbrlware/Item.html +278 -0
- data/doc/classes/Xbrlware/LBConstants.html +144 -0
- data/doc/classes/Xbrlware/Linkbase.html +131 -0
- data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase.html +212 -0
- data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation.html +172 -0
- data/doc/classes/Xbrlware/Linkbase/CalculationLinkbase/Calculation/CalculationArc.html +166 -0
- data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase.html +210 -0
- data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition.html +204 -0
- data/doc/classes/Xbrlware/Linkbase/DefinitionLinkbase/Definition/DefinitionArc.html +160 -0
- data/doc/classes/Xbrlware/Linkbase/LabelLinkbase.html +239 -0
- data/doc/classes/Xbrlware/Linkbase/LabelLinkbase/Label.html +189 -0
- data/doc/classes/Xbrlware/Linkbase/Linkbase.html +172 -0
- data/doc/classes/Xbrlware/Linkbase/Linkbase/Link.html +217 -0
- data/doc/classes/Xbrlware/Linkbase/Linkbase/Link/Arc.html +284 -0
- data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase.html +224 -0
- data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation.html +222 -0
- data/doc/classes/Xbrlware/Linkbase/PresentationLinkbase/Presentation/PresentationArc.html +160 -0
- data/doc/classes/Xbrlware/Taxonomy.html +369 -0
- data/doc/classes/Xbrlware/TaxonomyDefintion.html +177 -0
- data/doc/classes/Xbrlware/Unit.html +179 -0
- data/doc/classes/Xbrlware/Unit/Divide.html +165 -0
- data/doc/created.rid +1 -0
- data/doc/files/Readme_txt.html +124 -0
- data/doc/files/lib/edgar/edgar_data_downloader_rb.html +129 -0
- data/doc/files/lib/edgar/util_rb.html +129 -0
- data/doc/files/lib/edgar_rb.html +141 -0
- data/doc/files/lib/xbrlware/constants_rb.html +129 -0
- data/doc/files/lib/xbrlware/context_rb.html +129 -0
- data/doc/files/lib/xbrlware/date_util_rb.html +129 -0
- data/doc/files/lib/xbrlware/float_patch_rb.html +129 -0
- data/doc/files/lib/xbrlware/hash_util_rb.html +129 -0
- data/doc/files/lib/xbrlware/instance_rb.html +129 -0
- data/doc/files/lib/xbrlware/item_rb.html +129 -0
- data/doc/files/lib/xbrlware/linkbase/calculation_linkbase_rb.html +129 -0
- data/doc/files/lib/xbrlware/linkbase/definition_linkbase_rb.html +129 -0
- data/doc/files/lib/xbrlware/linkbase/label_linkbase_rb.html +129 -0
- data/doc/files/lib/xbrlware/linkbase/linkbase_rb.html +129 -0
- data/doc/files/lib/xbrlware/linkbase/presentation_linkbase_rb.html +129 -0
- data/doc/files/lib/xbrlware/meta_util_rb.html +129 -0
- data/doc/files/lib/xbrlware/taxonomy_rb.html +129 -0
- data/doc/files/lib/xbrlware/unit_rb.html +129 -0
- data/doc/files/lib/xbrlware/util_rb.html +129 -0
- data/doc/files/lib/xbrlware/xml_parser_rb.html +129 -0
- data/doc/files/lib/xbrlware_rb.html +163 -0
- data/doc/fr_class_index.html +55 -0
- data/doc/fr_file_index.html +48 -0
- data/doc/fr_method_index.html +104 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/example/benchmark/instance_parser_benchmark.rb +25 -0
- data/example/case_study/buy_strategy.rb +34 -0
- data/example/case_study/c-20091230.xml +29 -0
- data/example/case_study/c_sell_strategy.rb +29 -0
- data/example/lang_integration/thrift/rating-client.py +21 -0
- data/example/lang_integration/thrift/rating-impl.rb +13 -0
- data/example/lang_integration/thrift/rating-server.rb +25 -0
- data/example/lang_integration/thrift/rating.thrift +52 -0
- data/example/quick_start/foo.rb +10 -0
- data/example/quick_start/foo.xml +29 -0
- data/example/quick_start/print_item.rb +27 -0
- data/lib/edgar.rb +30 -0
- data/lib/edgar/edgar_data_downloader.rb +126 -0
- data/lib/edgar/util.rb +30 -0
- data/lib/xbrlware.rb +65 -0
- data/lib/xbrlware/constants.rb +29 -0
- data/lib/xbrlware/context.rb +148 -0
- data/lib/xbrlware/date_util.rb +35 -0
- data/lib/xbrlware/float_patch.rb +26 -0
- data/lib/xbrlware/hash_util.rb +175 -0
- data/lib/xbrlware/instance.rb +406 -0
- data/lib/xbrlware/item.rb +115 -0
- data/lib/xbrlware/linkbase/calculation_linkbase.rb +137 -0
- data/lib/xbrlware/linkbase/definition_linkbase.rb +186 -0
- data/lib/xbrlware/linkbase/label_linkbase.rb +128 -0
- data/lib/xbrlware/linkbase/linkbase.rb +170 -0
- data/lib/xbrlware/linkbase/presentation_linkbase.rb +160 -0
- data/lib/xbrlware/meta_util.rb +45 -0
- data/lib/xbrlware/taxonomies/us_gaap_taxonomy_20090131.rb +40365 -0
- data/lib/xbrlware/taxonomy.rb +133 -0
- data/lib/xbrlware/unit.rb +42 -0
- data/lib/xbrlware/util.rb +83 -0
- data/lib/xbrlware/xml_parser.rb +122 -0
- data/setup.rb +1585 -0
- data/test/lib/edgar/edgar_data_downloader_test.rb +35 -0
- data/test/lib/edgar/resources/0000930413-09-005485-index.htm +331 -0
- data/test/lib/edgar/resources/usgaap.rss.xml +2861 -0
- data/test/lib/xbrlware/411_footnotes_test.rb +65 -0
- data/test/lib/xbrlware/42_schemaref_test.rb +20 -0
- data/test/lib/xbrlware/46_item_test.rb +253 -0
- data/test/lib/xbrlware/47_context_test.rb +129 -0
- data/test/lib/xbrlware/48_unit_test.rb +45 -0
- data/test/lib/xbrlware/49_tuple_test.rb +12 -0
- data/test/lib/xbrlware/date_util_test.rb +24 -0
- data/test/lib/xbrlware/dimension/context_explicit_dimension_test.rb +40 -0
- data/test/lib/xbrlware/dimension/resources/context_explicit_dimension.xml +84 -0
- data/test/lib/xbrlware/float_patch_test.rb +10 -0
- data/test/lib/xbrlware/hash_util_test.rb +29 -0
- data/test/lib/xbrlware/instance_test.rb +250 -0
- data/test/lib/xbrlware/linkbase/calculation_linkbase_test.rb +39 -0
- data/test/lib/xbrlware/linkbase/definition_linkbase_test.rb +35 -0
- data/test/lib/xbrlware/linkbase/label_linkbase_test.rb +22 -0
- data/test/lib/xbrlware/linkbase/linkbase_test.rb +36 -0
- data/test/lib/xbrlware/linkbase/linkbase_test_util.rb +98 -0
- data/test/lib/xbrlware/linkbase/presentation_linkbase_test.rb +33 -0
- data/test/lib/xbrlware/linkbase/report.html +62 -0
- data/test/lib/xbrlware/linkbase/resources/cal.xml +219 -0
- data/test/lib/xbrlware/linkbase/resources/def.xml +186 -0
- data/test/lib/xbrlware/linkbase/resources/def_with_multiple_dimension.xml +41 -0
- data/test/lib/xbrlware/linkbase/resources/instance.xml +5822 -0
- data/test/lib/xbrlware/linkbase/resources/lab.xml +782 -0
- data/test/lib/xbrlware/linkbase/resources/pre.xml +485 -0
- data/test/lib/xbrlware/linkbase/resources/report_10_q.htm +12327 -0
- data/test/lib/xbrlware/linkbase/resources/taxonomy.xsd +178 -0
- data/test/lib/xbrlware/linkbase/sample_html_report.html +40 -0
- data/test/lib/xbrlware/meta_util_test.rb +23 -0
- data/test/lib/xbrlware/resources/411/411_footnotes.xml +66 -0
- data/test/lib/xbrlware/resources/42/42_schema_ref_with_base.xml +7 -0
- data/test/lib/xbrlware/resources/42/42_schema_ref_without_base.xml +7 -0
- data/test/lib/xbrlware/resources/46/46_item_value.xml +61 -0
- data/test/lib/xbrlware/resources/47/472_period_forever.xml +29 -0
- data/test/lib/xbrlware/resources/47/472_period_instant.xml +24 -0
- data/test/lib/xbrlware/resources/47/472_period_start_dt_and_end_dt.xml +30 -0
- data/test/lib/xbrlware/resources/47/4731_entity_identifier.xml +29 -0
- data/test/lib/xbrlware/resources/47/4732_entity_segment_not_present.xml +24 -0
- data/test/lib/xbrlware/resources/47/4732_entity_segment_present.xml +30 -0
- data/test/lib/xbrlware/resources/47/474_scenario_not_present.xml +26 -0
- data/test/lib/xbrlware/resources/47/474_scenario_present.xml +30 -0
- data/test/lib/xbrlware/resources/47/47_multiple_contexts.xml +36 -0
- data/test/lib/xbrlware/resources/48/482_unit_measure.xml +32 -0
- data/test/lib/xbrlware/resources/48/483_unit_divide.xml +39 -0
- data/test/lib/xbrlware/resources/48/48_multiple_units.xml +43 -0
- data/test/lib/xbrlware/resources/49/49_tuple.xml +61 -0
- data/test/lib/xbrlware/resources/49_tuple.xsd +44 -0
- data/test/lib/xbrlware/resources/instance.xml +128 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/cal.xml +219 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/def.xml +186 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/instance.xml +5822 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/lab.xml +782 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/pre.xml +485 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/report/report_index.html +62 -0
- data/test/lib/xbrlware/resources/report_test_xbrl_files/taxonomy.xsd +178 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/1/cal.xml +223 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/1/def.xml +190 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/1/lab.xml +786 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/1/pre.xml +489 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/1/taxonomy.xsd +177 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/cal.xml +223 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/def.xml +190 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/lab.xml +786 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/2/linkbases/pre.xml +489 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/2/taxonomy.xsd +175 -0
- data/test/lib/xbrlware/resources/taxonomy_test_files/3/taxonomy.xsd +175 -0
- data/test/lib/xbrlware/resources/us_gaap_schema.xsd +8 -0
- data/test/lib/xbrlware/resources/us_gaap_schema_local.xsd +10 -0
- data/test/lib/xbrlware/resources/util_test_xbrl_files/cal.xml +219 -0
- data/test/lib/xbrlware/resources/util_test_xbrl_files/def.xml +186 -0
- data/test/lib/xbrlware/resources/util_test_xbrl_files/instance.xml +5822 -0
- data/test/lib/xbrlware/resources/util_test_xbrl_files/lab.xml +782 -0
- data/test/lib/xbrlware/resources/util_test_xbrl_files/pre.xml +485 -0
- data/test/lib/xbrlware/resources/util_test_xbrl_files/taxonomy.xsd +178 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/dei-2009-01-31.xsd +162 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/dei-std-2009-01-31.xsd +23 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/negated-2008-03-31.xsd +23 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/ref-2006-02-27.xsd +121 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/us-gaap-2009-01-31.xsd +13474 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/us-roles-2009-01-31.xsd +2283 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/us-types-2009-01-31.xsd +368 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/xbrl-instance-2003-12-31.xsd +772 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/xbrl-linkbase-2003-12-31.xsd +477 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/xbrldi-2006.xsd +41 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/xbrldt-2005.xsd +53 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/xl-2003-12-31.xsd +246 -0
- data/test/lib/xbrlware/resources/xbrl_xsd/xlink-2003-12-31.xsd +117 -0
- data/test/lib/xbrlware/taxonomy_test.rb +124 -0
- data/test/lib/xbrlware/util_test.rb +18 -0
- data/test/lib/xbrlware/xml_parser_test.rb +142 -0
- data/test/schema_validator_jruby.rb +40 -0
- data/test/schema_validator_ruby.rb +7 -0
- data/test/scratchpad/block.rb +36 -0
- data/test/test_helper.rb +21 -0
- data/xbrlware.iml +30 -0
- metadata +261 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Xbrlware::Identifier</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Xbrlware::Identifier</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/xbrlware/context_rb.html">
|
59
|
+
lib/xbrlware/context.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000060">new</a>
|
90
|
+
<a href="#M000061">to_s</a>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if includes -->
|
98
|
+
|
99
|
+
<div id="section">
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<div id="attribute-list">
|
106
|
+
<h3 class="section-bar">Attributes</h3>
|
107
|
+
|
108
|
+
<div class="name-list">
|
109
|
+
<table>
|
110
|
+
<tr class="top-aligned-row context-row">
|
111
|
+
<td class="context-item-name">scheme</td>
|
112
|
+
<td class="context-item-value"> [R] </td>
|
113
|
+
<td class="context-item-desc"></td>
|
114
|
+
</tr>
|
115
|
+
<tr class="top-aligned-row context-row">
|
116
|
+
<td class="context-item-name">value</td>
|
117
|
+
<td class="context-item-value"> [R] </td>
|
118
|
+
<td class="context-item-desc"></td>
|
119
|
+
</tr>
|
120
|
+
</table>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<!-- if method_list -->
|
127
|
+
<div id="methods">
|
128
|
+
<h3 class="section-bar">Public Class methods</h3>
|
129
|
+
|
130
|
+
<div id="method-M000060" class="method-detail">
|
131
|
+
<a name="M000060"></a>
|
132
|
+
|
133
|
+
<div class="method-heading">
|
134
|
+
<a href="#M000060" class="method-signature">
|
135
|
+
<span class="method-name">new</span><span class="method-args">(scheme,value)</span>
|
136
|
+
</a>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div class="method-description">
|
140
|
+
<p><a class="source-toggle" href="#"
|
141
|
+
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
142
|
+
<div class="method-source-code" id="M000060-source">
|
143
|
+
<pre>
|
144
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/context.rb, line 139</span>
|
145
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">scheme</span>,<span class="ruby-identifier">value</span>)
|
146
|
+
<span class="ruby-ivar">@scheme</span> = <span class="ruby-identifier">scheme</span>
|
147
|
+
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span>
|
148
|
+
<span class="ruby-keyword kw">end</span>
|
149
|
+
</pre>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
155
|
+
|
156
|
+
<div id="method-M000061" class="method-detail">
|
157
|
+
<a name="M000061"></a>
|
158
|
+
|
159
|
+
<div class="method-heading">
|
160
|
+
<a href="#M000061" class="method-signature">
|
161
|
+
<span class="method-name">to_s</span><span class="method-args">()</span>
|
162
|
+
</a>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
<p><a class="source-toggle" href="#"
|
167
|
+
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000061-source">
|
169
|
+
<pre>
|
170
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/context.rb, line 144</span>
|
171
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
172
|
+
<span class="ruby-value str">"schema ["</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@scheme</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"], value ["</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@value</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"]"</span>
|
173
|
+
<span class="ruby-keyword kw">end</span>
|
174
|
+
</pre>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
<div id="validator-badges">
|
187
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
</body>
|
191
|
+
</html>
|
@@ -0,0 +1,742 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Xbrlware::Instance</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Xbrlware::Instance</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/xbrlware/instance_rb.html">
|
59
|
+
lib/xbrlware/instance.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Class to deal with valid, well-formatted XBRl instance file. This class
|
84
|
+
provides methods to deal with instance file. Look at <a
|
85
|
+
href="http://code.google.com/p/xbrlware/wiki/InstanceTaxonomy">delaing with
|
86
|
+
instance page on xbrlware wiki</a> for more details.
|
87
|
+
</p>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
<div id="method-list">
|
95
|
+
<h3 class="section-bar">Methods</h3>
|
96
|
+
|
97
|
+
<div class="name-list">
|
98
|
+
<a href="#M000065">context</a>
|
99
|
+
<a href="#M000072">context_for_item</a>
|
100
|
+
<a href="#M000066">ctx_groupby_dim</a>
|
101
|
+
<a href="#M000069">ctx_groupby_dim_dom_print</a>
|
102
|
+
<a href="#M000067">ctx_groupby_dom</a>
|
103
|
+
<a href="#M000068">ctx_groupby_period</a>
|
104
|
+
<a href="#M000075">entity_details</a>
|
105
|
+
<a href="#M000074">footnotes</a>
|
106
|
+
<a href="#M000071">item</a>
|
107
|
+
<a href="#M000073">item_ctx_filter</a>
|
108
|
+
<a href="#M000062">new</a>
|
109
|
+
<a href="#M000063">raw</a>
|
110
|
+
<a href="#M000064">schema_ref</a>
|
111
|
+
<a href="#M000070">unit</a>
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
<!-- if includes -->
|
119
|
+
|
120
|
+
<div id="section">
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<div id="attribute-list">
|
127
|
+
<h3 class="section-bar">Attributes</h3>
|
128
|
+
|
129
|
+
<div class="name-list">
|
130
|
+
<table>
|
131
|
+
<tr class="top-aligned-row context-row">
|
132
|
+
<td class="context-item-name">taxonomy</td>
|
133
|
+
<td class="context-item-value"> [R] </td>
|
134
|
+
<td class="context-item-desc"></td>
|
135
|
+
</tr>
|
136
|
+
</table>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<!-- if method_list -->
|
143
|
+
<div id="methods">
|
144
|
+
<h3 class="section-bar">Public Class methods</h3>
|
145
|
+
|
146
|
+
<div id="method-M000062" class="method-detail">
|
147
|
+
<a name="M000062"></a>
|
148
|
+
|
149
|
+
<div class="method-heading">
|
150
|
+
<a href="#M000062" class="method-signature">
|
151
|
+
<span class="method-name">new</span><span class="method-args">(instance_filepath, taxonomy_filepath=nil)</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p>
|
157
|
+
Creates an <a href="Instance.html">Instance</a>.
|
158
|
+
</p>
|
159
|
+
<table>
|
160
|
+
<tr><td valign="top">instance_filepath:</td><td>XBRL <a href="Instance.html">Instance</a> source. Tries to load and parse
|
161
|
+
instance file from the path.
|
162
|
+
|
163
|
+
</td></tr>
|
164
|
+
<tr><td valign="top">taxonomy_filepath:</td><td>optional parameter, XBRL <a href="Taxonomy.html">Taxonomy</a> source. Tries
|
165
|
+
to load and parse taxonomy file from path. If this param is specified,
|
166
|
+
taxonomy file in the instance document will be ignored
|
167
|
+
|
168
|
+
</td></tr>
|
169
|
+
</table>
|
170
|
+
<p>
|
171
|
+
Expects instance source is well-formatted and valid Sometimes instance
|
172
|
+
document contains large chunk of HTML content with <a
|
173
|
+
href="Instance.html#M000062">new</a> lines in-between, which will cause
|
174
|
+
parsing error. Hence any exceptions during instance source parsing, will
|
175
|
+
trigger re-parsing of the entire instnace file with <a
|
176
|
+
href="Instance.html#M000062">new</a> lines replaced. Look at <a
|
177
|
+
href="http://code.google.com/p/xbrlware/wiki/InstanceTaxonomy">delaing with
|
178
|
+
instance page on xbrlware wiki</a> for details.
|
179
|
+
</p>
|
180
|
+
<p><a class="source-toggle" href="#"
|
181
|
+
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
182
|
+
<div class="method-source-code" id="M000062-source">
|
183
|
+
<pre>
|
184
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 42</span>
|
185
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">instance_filepath</span>, <span class="ruby-identifier">taxonomy_filepath</span>=<span class="ruby-keyword kw">nil</span>)
|
186
|
+
<span class="ruby-identifier">m</span>=<span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">measure</span> <span class="ruby-keyword kw">do</span>
|
187
|
+
<span class="ruby-keyword kw">begin</span>
|
188
|
+
<span class="ruby-ivar">@file_name</span>=<span class="ruby-identifier">instance_filepath</span>
|
189
|
+
<span class="ruby-ivar">@xbrl_content</span> = <span class="ruby-constant">XmlParser</span>.<span class="ruby-identifier">xml_in</span>(<span class="ruby-identifier">instance_filepath</span>, {<span class="ruby-value str">'ForceContent'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>})
|
190
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
|
191
|
+
<span class="ruby-identifier">$LOG</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">"File ["</span><span class="ruby-operator">+</span><span class="ruby-identifier">instance_filepath</span><span class="ruby-operator">+</span><span class="ruby-value str">"] is not well formed. Starting reparsing after removing new lines."</span>
|
192
|
+
<span class="ruby-ivar">@xbrl_content</span> = <span class="ruby-constant">XmlParser</span>.<span class="ruby-identifier">xml_in</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">instance_filepath</span>).<span class="ruby-identifier">read</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">"\n"</span>, <span class="ruby-value str">""</span>), {<span class="ruby-value str">'ForceContent'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>})
|
193
|
+
<span class="ruby-keyword kw">end</span>
|
194
|
+
<span class="ruby-keyword kw">end</span>
|
195
|
+
<span class="ruby-identifier">bm</span>(<span class="ruby-value str">"Parsing ["</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">instance_filepath</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"] took"</span>, <span class="ruby-identifier">m</span>)
|
196
|
+
|
197
|
+
<span class="ruby-comment cmt"># if taxonomy file is not supplied, get it from instance schema_ref</span>
|
198
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">taxonomy_filepath</span>.<span class="ruby-identifier">nil?</span>
|
199
|
+
<span class="ruby-identifier">taxonomy_file_location</span>=<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">instance_filepath</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-identifier">schema_ref</span>
|
200
|
+
<span class="ruby-identifier">taxonomy_filepath</span> = <span class="ruby-identifier">taxonomy_file_location</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">taxonomy_file_location</span>) <span class="ruby-operator">&&</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">taxonomy_file_location</span>))
|
201
|
+
<span class="ruby-keyword kw">end</span>
|
202
|
+
|
203
|
+
<span class="ruby-ivar">@taxonomy</span>=<span class="ruby-constant">Xbrlware</span><span class="ruby-operator">::</span><span class="ruby-constant">Taxonomy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">taxonomy_filepath</span>, <span class="ruby-keyword kw">self</span>)
|
204
|
+
<span class="ruby-keyword kw">end</span>
|
205
|
+
</pre>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
211
|
+
|
212
|
+
<div id="method-M000065" class="method-detail">
|
213
|
+
<a name="M000065"></a>
|
214
|
+
|
215
|
+
<div class="method-heading">
|
216
|
+
<a href="#M000065" class="method-signature">
|
217
|
+
<span class="method-name">context</span><span class="method-args">(context_id=nil, dimensions=[])</span>
|
218
|
+
</a>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="method-description">
|
222
|
+
<p>
|
223
|
+
Takes optional context_id as string and dimensions as array
|
224
|
+
</p>
|
225
|
+
<pre>
|
226
|
+
Returns all contexts when context_id is nil
|
227
|
+
Returns instance of Context object if context_id or dimensions is passed and matching context exist
|
228
|
+
Returns nil if context_id or dimensions is passed and no matching context exist
|
229
|
+
</pre>
|
230
|
+
<p><a class="source-toggle" href="#"
|
231
|
+
onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
|
232
|
+
<div class="method-source-code" id="M000065-source">
|
233
|
+
<pre>
|
234
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 80</span>
|
235
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">context</span>(<span class="ruby-identifier">context_id</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">dimensions</span>=[])
|
236
|
+
<span class="ruby-identifier">all_contexts</span>= <span class="ruby-identifier">context_by_id</span>(<span class="ruby-identifier">context_id</span>)
|
237
|
+
|
238
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">all_contexts</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dimensions</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>
|
239
|
+
|
240
|
+
<span class="ruby-identifier">contexts</span>=[]
|
241
|
+
|
242
|
+
<span class="ruby-identifier">all_contexts</span>=[<span class="ruby-identifier">all_contexts</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
243
|
+
<span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span>
|
244
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">has_explicit_dimensions?</span>(<span class="ruby-identifier">dimensions</span>)
|
245
|
+
<span class="ruby-identifier">contexts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">ctx</span>
|
246
|
+
<span class="ruby-keyword kw">end</span>
|
247
|
+
|
248
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">contexts</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">context_id</span>.<span class="ruby-identifier">nil?</span>
|
249
|
+
<span class="ruby-identifier">contexts</span>
|
250
|
+
<span class="ruby-keyword kw">end</span>
|
251
|
+
</pre>
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div id="method-M000072" class="method-detail">
|
257
|
+
<a name="M000072"></a>
|
258
|
+
|
259
|
+
<div class="method-heading">
|
260
|
+
<a href="#M000072" class="method-signature">
|
261
|
+
<span class="method-name">context_for_item</span><span class="method-args">(item_name)</span>
|
262
|
+
</a>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div class="method-description">
|
266
|
+
<p>
|
267
|
+
Takes <a href="Instance.html#M000071">item</a> name
|
268
|
+
</p>
|
269
|
+
<pre>
|
270
|
+
Returns array of contexts for given item name
|
271
|
+
Returns empty array if no item with given name found
|
272
|
+
</pre>
|
273
|
+
<p><a class="source-toggle" href="#"
|
274
|
+
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
275
|
+
<div class="method-source-code" id="M000072-source">
|
276
|
+
<pre>
|
277
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 291</span>
|
278
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">context_for_item</span>(<span class="ruby-identifier">item_name</span>)
|
279
|
+
<span class="ruby-identifier">contexts</span>=[]
|
280
|
+
<span class="ruby-identifier">items</span> = <span class="ruby-identifier">item</span>(<span class="ruby-identifier">item_name</span>)
|
281
|
+
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">contexts</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">context</span>}
|
282
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">contexts</span>
|
283
|
+
<span class="ruby-keyword kw">end</span>
|
284
|
+
</pre>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<div id="method-M000066" class="method-detail">
|
290
|
+
<a name="M000066"></a>
|
291
|
+
|
292
|
+
<div class="method-heading">
|
293
|
+
<a href="#M000066" class="method-signature">
|
294
|
+
<span class="method-name">ctx_groupby_dim</span><span class="method-args">()</span>
|
295
|
+
</a>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
<p>
|
300
|
+
Returns contexts grouped by dimension as map. Map contains dimension as key
|
301
|
+
and corresponding contexts as value
|
302
|
+
</p>
|
303
|
+
<p><a class="source-toggle" href="#"
|
304
|
+
onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
|
305
|
+
<div class="method-source-code" id="M000066-source">
|
306
|
+
<pre>
|
307
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 98</span>
|
308
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ctx_groupby_dim</span>
|
309
|
+
<span class="ruby-identifier">dim_group</span>={}
|
310
|
+
<span class="ruby-identifier">all_contexts</span>= <span class="ruby-identifier">context</span>
|
311
|
+
<span class="ruby-identifier">all_contexts</span>=[<span class="ruby-identifier">all_contexts</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
312
|
+
<span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span>
|
313
|
+
<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">explicit_dimensions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dim</span><span class="ruby-operator">|</span>
|
314
|
+
<span class="ruby-identifier">dim_group</span>[<span class="ruby-identifier">dim</span>] = [] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dim_group</span>[<span class="ruby-identifier">dim</span>].<span class="ruby-identifier">nil?</span>
|
315
|
+
<span class="ruby-identifier">dim_group</span>[<span class="ruby-identifier">dim</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">ctx</span>
|
316
|
+
<span class="ruby-keyword kw">end</span>
|
317
|
+
<span class="ruby-keyword kw">end</span>
|
318
|
+
<span class="ruby-identifier">dim_group</span>
|
319
|
+
<span class="ruby-keyword kw">end</span>
|
320
|
+
</pre>
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div id="method-M000069" class="method-detail">
|
326
|
+
<a name="M000069"></a>
|
327
|
+
|
328
|
+
<div class="method-heading">
|
329
|
+
<a href="#M000069" class="method-signature">
|
330
|
+
<span class="method-name">ctx_groupby_dim_dom_print</span><span class="method-args">()</span>
|
331
|
+
</a>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div class="method-description">
|
335
|
+
<p>
|
336
|
+
Prints dimension -> domain -> <a
|
337
|
+
href="Instance.html#M000065">context</a> relationship for all contexts in
|
338
|
+
the console.
|
339
|
+
</p>
|
340
|
+
<p><a class="source-toggle" href="#"
|
341
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
342
|
+
<div class="method-source-code" id="M000069-source">
|
343
|
+
<pre>
|
344
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 140</span>
|
345
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ctx_groupby_dim_dom_print</span>
|
346
|
+
<span class="ruby-identifier">group_dim</span>=<span class="ruby-identifier">ctx_groupby_dim</span>
|
347
|
+
<span class="ruby-identifier">group_dim</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dimension</span><span class="ruby-operator">|</span>
|
348
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">" dimension :: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dimension</span>
|
349
|
+
<span class="ruby-identifier">group_dom</span>=<span class="ruby-identifier">ctx_groupby_dom</span>(<span class="ruby-identifier">dimension</span>)
|
350
|
+
<span class="ruby-identifier">group_dom</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">domain</span><span class="ruby-operator">|</span>
|
351
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">" \t domain :: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">domain</span>
|
352
|
+
<span class="ruby-identifier">group_dom</span>[<span class="ruby-identifier">domain</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span>
|
353
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">" \t\t ctx :: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">id</span>
|
354
|
+
<span class="ruby-keyword kw">end</span>
|
355
|
+
<span class="ruby-keyword kw">end</span>
|
356
|
+
<span class="ruby-keyword kw">end</span>
|
357
|
+
<span class="ruby-keyword kw">end</span>
|
358
|
+
</pre>
|
359
|
+
</div>
|
360
|
+
</div>
|
361
|
+
</div>
|
362
|
+
|
363
|
+
<div id="method-M000067" class="method-detail">
|
364
|
+
<a name="M000067"></a>
|
365
|
+
|
366
|
+
<div class="method-heading">
|
367
|
+
<a href="#M000067" class="method-signature">
|
368
|
+
<span class="method-name">ctx_groupby_dom</span><span class="method-args">(dimensions=[])</span>
|
369
|
+
</a>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
<div class="method-description">
|
373
|
+
<p>
|
374
|
+
Takes optional dimensions as array
|
375
|
+
</p>
|
376
|
+
<pre>
|
377
|
+
Returns contexts group by domain as map. Map contains domain as key and corresponding contexts as value
|
378
|
+
</pre>
|
379
|
+
<p><a class="source-toggle" href="#"
|
380
|
+
onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
|
381
|
+
<div class="method-source-code" id="M000067-source">
|
382
|
+
<pre>
|
383
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 113</span>
|
384
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ctx_groupby_dom</span>(<span class="ruby-identifier">dimensions</span>=[])
|
385
|
+
<span class="ruby-identifier">dom_group</span>={}
|
386
|
+
<span class="ruby-identifier">all_contexts</span>= <span class="ruby-identifier">context</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">dimensions</span>)
|
387
|
+
<span class="ruby-identifier">all_contexts</span>=[<span class="ruby-identifier">all_contexts</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
388
|
+
<span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span>
|
389
|
+
<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">explicit_domains</span>(<span class="ruby-identifier">dimensions</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dom</span><span class="ruby-operator">|</span>
|
390
|
+
<span class="ruby-identifier">dom_group</span>[<span class="ruby-identifier">dom</span>] = [] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dom_group</span>[<span class="ruby-identifier">dom</span>].<span class="ruby-identifier">nil?</span>
|
391
|
+
<span class="ruby-identifier">dom_group</span>[<span class="ruby-identifier">dom</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">ctx</span>
|
392
|
+
<span class="ruby-keyword kw">end</span>
|
393
|
+
<span class="ruby-keyword kw">end</span>
|
394
|
+
<span class="ruby-identifier">dom_group</span>
|
395
|
+
<span class="ruby-keyword kw">end</span>
|
396
|
+
</pre>
|
397
|
+
</div>
|
398
|
+
</div>
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div id="method-M000068" class="method-detail">
|
402
|
+
<a name="M000068"></a>
|
403
|
+
|
404
|
+
<div class="method-heading">
|
405
|
+
<a href="#M000068" class="method-signature">
|
406
|
+
<span class="method-name">ctx_groupby_period</span><span class="method-args">(dimensions=[])</span>
|
407
|
+
</a>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
<div class="method-description">
|
411
|
+
<p>
|
412
|
+
Takes optional dimensions as array
|
413
|
+
</p>
|
414
|
+
<pre>
|
415
|
+
Returns contexts group by period as map. Map contains period as key and corresponding contexts as value
|
416
|
+
</pre>
|
417
|
+
<p><a class="source-toggle" href="#"
|
418
|
+
onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
|
419
|
+
<div class="method-source-code" id="M000068-source">
|
420
|
+
<pre>
|
421
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 128</span>
|
422
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ctx_groupby_period</span>(<span class="ruby-identifier">dimensions</span>=[])
|
423
|
+
<span class="ruby-identifier">period_group</span>={}
|
424
|
+
<span class="ruby-identifier">all_contexts</span>= <span class="ruby-identifier">context</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">dimensions</span>)
|
425
|
+
<span class="ruby-identifier">all_contexts</span>=[<span class="ruby-identifier">all_contexts</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
426
|
+
<span class="ruby-identifier">all_contexts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ctx</span><span class="ruby-operator">|</span>
|
427
|
+
<span class="ruby-identifier">period_group</span>[<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">period</span>.<span class="ruby-identifier">to_s</span>] = [] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">period_group</span>[<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">period</span>.<span class="ruby-identifier">to_s</span>].<span class="ruby-identifier">nil?</span>
|
428
|
+
<span class="ruby-identifier">period_group</span>[<span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">period</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">ctx</span>
|
429
|
+
<span class="ruby-keyword kw">end</span>
|
430
|
+
<span class="ruby-identifier">period_group</span>
|
431
|
+
<span class="ruby-keyword kw">end</span>
|
432
|
+
</pre>
|
433
|
+
</div>
|
434
|
+
</div>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
<div id="method-M000075" class="method-detail">
|
438
|
+
<a name="M000075"></a>
|
439
|
+
|
440
|
+
<div class="method-heading">
|
441
|
+
<a href="#M000075" class="method-signature">
|
442
|
+
<span class="method-name">entity_details</span><span class="method-args">()</span>
|
443
|
+
</a>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
<div class="method-description">
|
447
|
+
<p><a class="source-toggle" href="#"
|
448
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
449
|
+
<div class="method-source-code" id="M000075-source">
|
450
|
+
<pre>
|
451
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 331</span>
|
452
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entity_details</span>
|
453
|
+
<span class="ruby-ivar">@entity_details</span>={}
|
454
|
+
<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>
|
455
|
+
<span class="ruby-identifier">e_name</span>=<span class="ruby-identifier">item</span>(<span class="ruby-value str">"EntityRegistrantName"</span>)[<span class="ruby-value">0</span>]
|
456
|
+
<span class="ruby-identifier">e_ci_key</span>=<span class="ruby-identifier">item</span>(<span class="ruby-value str">"EntityCentralIndexKey"</span>)[<span class="ruby-value">0</span>]
|
457
|
+
<span class="ruby-identifier">e_doc_type</span>=<span class="ruby-identifier">item</span>(<span class="ruby-value str">"DocumentType"</span>)[<span class="ruby-value">0</span>]
|
458
|
+
<span class="ruby-identifier">e_doc_end_type</span>=<span class="ruby-identifier">item</span>(<span class="ruby-value str">"DocumentPeriodEndDate"</span>)[<span class="ruby-value">0</span>]
|
459
|
+
|
460
|
+
<span class="ruby-identifier">fedate</span>=<span class="ruby-identifier">item</span>(<span class="ruby-value str">"CurrentFiscalYearEndDate"</span>)
|
461
|
+
<span class="ruby-identifier">e_fiscal_end_date</span>=<span class="ruby-identifier">fedate</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">fedate</span>.<span class="ruby-identifier">nil?</span>
|
462
|
+
|
463
|
+
<span class="ruby-identifier">shares_outstanding</span> = <span class="ruby-identifier">item</span>(<span class="ruby-value str">"EntityCommonStockSharesOutstanding"</span>)
|
464
|
+
<span class="ruby-identifier">e_common_shares_outstanding</span>=<span class="ruby-identifier">shares_outstanding</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">shares_outstanding</span>.<span class="ruby-identifier">nil?</span>
|
465
|
+
|
466
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"name"</span>]=<span class="ruby-identifier">e_name</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e_name</span>.<span class="ruby-identifier">nil?</span>
|
467
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"ci_key"</span>]=<span class="ruby-identifier">e_ci_key</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e_ci_key</span>.<span class="ruby-identifier">nil?</span>
|
468
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"doc_type"</span>]=<span class="ruby-identifier">e_doc_type</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e_doc_type</span>.<span class="ruby-identifier">nil?</span>
|
469
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"doc_end_date"</span>]=<span class="ruby-identifier">e_doc_end_type</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e_doc_end_type</span>.<span class="ruby-identifier">nil?</span>
|
470
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"fiscal_end_date"</span>]=<span class="ruby-identifier">e_fiscal_end_date</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e_fiscal_end_date</span>.<span class="ruby-identifier">nil?</span>
|
471
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"common_shares_outstanding"</span>]=<span class="ruby-identifier">e_common_shares_outstanding</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">e_common_shares_outstanding</span>.<span class="ruby-identifier">nil?</span>
|
472
|
+
|
473
|
+
<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
|
+
<span class="ruby-identifier">symbol</span>=<span class="ruby-identifier">file_name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"-"</span>)[<span class="ruby-value">0</span>]
|
475
|
+
<span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">upcase!</span>
|
476
|
+
|
477
|
+
<span class="ruby-ivar">@entity_details</span>[<span class="ruby-value str">"symbol"</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
|
+
<span class="ruby-keyword kw">end</span>
|
480
|
+
<span class="ruby-ivar">@entity_details</span>
|
481
|
+
<span class="ruby-keyword kw">end</span>
|
482
|
+
</pre>
|
483
|
+
</div>
|
484
|
+
</div>
|
485
|
+
</div>
|
486
|
+
|
487
|
+
<div id="method-M000074" class="method-detail">
|
488
|
+
<a name="M000074"></a>
|
489
|
+
|
490
|
+
<div class="method-heading">
|
491
|
+
<a href="#M000074" class="method-signature">
|
492
|
+
<span class="method-name">footnotes</span><span class="method-args">(item_id=nil, lang=nil)</span>
|
493
|
+
</a>
|
494
|
+
</div>
|
495
|
+
|
496
|
+
<div class="method-description">
|
497
|
+
<p>
|
498
|
+
Takes optional <a href="Instance.html#M000071">item</a> id and language
|
499
|
+
</p>
|
500
|
+
<pre>
|
501
|
+
Every item in XBRL instance file may contain optional id element.
|
502
|
+
Footnotes is associated with id of the item. Footnotes may be in different languages.
|
503
|
+
Returns Map with lang as key and corresponding footnotes in array as value if item_id is givien
|
504
|
+
Returns Map with item_id as key and another Map as value.
|
505
|
+
Second map has lang as key and corresponding footnotes in array as value if item_id is givien
|
506
|
+
Returns nil if no match found for item_it or footnotes not exist
|
507
|
+
</pre>
|
508
|
+
<p><a class="source-toggle" href="#"
|
509
|
+
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
|
510
|
+
<div class="method-source-code" id="M000074-source">
|
511
|
+
<pre>
|
512
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 320</span>
|
513
|
+
<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
|
+
<span class="ruby-ivar">@item_footnote_map</span>=<span class="ruby-keyword kw">nil</span>
|
515
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">" lang can't be passed when item id is nil"</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">&&</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">nil?</span>)
|
516
|
+
<span class="ruby-ivar">@item_footnote_map</span> = <span class="ruby-identifier">compute_footnotes</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@item_footnote_map</span>.<span class="ruby-identifier">nil?</span>
|
517
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@item_footnote_map</span>.<span class="ruby-identifier">nil?</span>
|
518
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@item_footnote_map</span>[<span class="ruby-identifier">item_id</span>] <span class="ruby-keyword kw">if</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">item_id</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">nil?</span>
|
519
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@item_footnote_map</span>[<span class="ruby-identifier">item_id</span>][<span class="ruby-identifier">lang</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">lang</span>.<span class="ruby-identifier">nil?</span>
|
520
|
+
<span class="ruby-ivar">@item_footnote_map</span>
|
521
|
+
<span class="ruby-keyword kw">end</span>
|
522
|
+
</pre>
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div id="method-M000071" class="method-detail">
|
528
|
+
<a name="M000071"></a>
|
529
|
+
|
530
|
+
<div class="method-heading">
|
531
|
+
<a href="#M000071" class="method-signature">
|
532
|
+
<span class="method-name">item</span><span class="method-args">(name, context_ref=nil, unit_ref=nil)</span>
|
533
|
+
</a>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
<div class="method-description">
|
537
|
+
<p>
|
538
|
+
Takes name and optional context_ref and unit_ref
|
539
|
+
</p>
|
540
|
+
<pre>
|
541
|
+
Returns array of Item for given name, context_ref and unit_ref
|
542
|
+
Returns empty array if item is not found
|
543
|
+
</pre>
|
544
|
+
<p><a class="source-toggle" href="#"
|
545
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
546
|
+
<div class="method-source-code" id="M000071-source">
|
547
|
+
<pre>
|
548
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 258</span>
|
549
|
+
<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
|
+
<span class="ruby-identifier">item_content</span> = <span class="ruby-ivar">@xbrl_content</span>[<span class="ruby-identifier">name</span>]
|
552
|
+
|
553
|
+
<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">item_content</span>.<span class="ruby-identifier">nil?</span>
|
554
|
+
|
555
|
+
<span class="ruby-identifier">items</span>=[]
|
556
|
+
|
557
|
+
<span class="ruby-identifier">item_content</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
|
558
|
+
|
559
|
+
<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">"contextRef"</span>]
|
560
|
+
<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">"unitRef"</span>]
|
561
|
+
|
562
|
+
<span class="ruby-identifier">context</span> = <span class="ruby-identifier">context</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">"contextRef"</span>])
|
563
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">"content"</span>]
|
564
|
+
|
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>
|
566
|
+
|
567
|
+
<span class="ruby-identifier">unit</span> = <span class="ruby-identifier">unit</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">"unitRef"</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">"unitRef"</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">"precision"</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">"precision"</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">"decimals"</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">"decimals"</span>].<span class="ruby-identifier">nil?</span>
|
570
|
+
|
571
|
+
<span class="ruby-identifier">_footnotes</span> = <span class="ruby-identifier">footnotes</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">"id"</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">item</span>[<span class="ruby-value str">"id"</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"><<</span> <span class="ruby-identifier">item</span>
|
575
|
+
<span class="ruby-keyword kw">end</span>
|
576
|
+
<span class="ruby-identifier">items</span>
|
577
|
+
<span class="ruby-keyword kw">end</span>
|
578
|
+
</pre>
|
579
|
+
</div>
|
580
|
+
</div>
|
581
|
+
</div>
|
582
|
+
|
583
|
+
<div id="method-M000073" class="method-detail">
|
584
|
+
<a name="M000073"></a>
|
585
|
+
|
586
|
+
<div class="method-heading">
|
587
|
+
<a href="#M000073" class="method-signature">
|
588
|
+
<span class="method-name">item_ctx_filter</span><span class="method-args">(name) {|item.context| ...}</span>
|
589
|
+
</a>
|
590
|
+
</div>
|
591
|
+
|
592
|
+
<div class="method-description">
|
593
|
+
<p>
|
594
|
+
Takes <a href="Instance.html#M000071">item</a> name and filter block
|
595
|
+
</p>
|
596
|
+
<pre>
|
597
|
+
Fetches item with name and invokes filter block with item context
|
598
|
+
Returns matched items.
|
599
|
+
</pre>
|
600
|
+
<p><a class="source-toggle" href="#"
|
601
|
+
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
602
|
+
<div class="method-source-code" id="M000073-source">
|
603
|
+
<pre>
|
604
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 302</span>
|
605
|
+
<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">&</span><span class="ruby-identifier">context_filter_block</span>)
|
606
|
+
<span class="ruby-identifier">items</span>=<span class="ruby-identifier">item</span>(<span class="ruby-identifier">name</span>)
|
607
|
+
<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>
|
608
|
+
<span class="ruby-identifier">filtered_items</span>=[]
|
609
|
+
<span class="ruby-identifier">items</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
|
610
|
+
<span class="ruby-identifier">filtered_items</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">item</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">item</span>.<span class="ruby-identifier">context</span>)
|
611
|
+
<span class="ruby-keyword kw">end</span>
|
612
|
+
<span class="ruby-identifier">filtered_items</span>
|
613
|
+
<span class="ruby-keyword kw">end</span>
|
614
|
+
</pre>
|
615
|
+
</div>
|
616
|
+
</div>
|
617
|
+
</div>
|
618
|
+
|
619
|
+
<div id="method-M000063" class="method-detail">
|
620
|
+
<a name="M000063"></a>
|
621
|
+
|
622
|
+
<div class="method-heading">
|
623
|
+
<a href="#M000063" class="method-signature">
|
624
|
+
<span class="method-name">raw</span><span class="method-args">()</span>
|
625
|
+
</a>
|
626
|
+
</div>
|
627
|
+
|
628
|
+
<div class="method-description">
|
629
|
+
<p>
|
630
|
+
Returns <a href="Instance.html#M000063">raw</a> content of instance file in
|
631
|
+
the form of Hash
|
632
|
+
</p>
|
633
|
+
<p><a class="source-toggle" href="#"
|
634
|
+
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
635
|
+
<div class="method-source-code" id="M000063-source">
|
636
|
+
<pre>
|
637
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 64</span>
|
638
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raw</span>
|
639
|
+
<span class="ruby-ivar">@xbrl_content</span>
|
640
|
+
<span class="ruby-keyword kw">end</span>
|
641
|
+
</pre>
|
642
|
+
</div>
|
643
|
+
</div>
|
644
|
+
</div>
|
645
|
+
|
646
|
+
<div id="method-M000064" class="method-detail">
|
647
|
+
<a name="M000064"></a>
|
648
|
+
|
649
|
+
<div class="method-heading">
|
650
|
+
<a href="#M000064" class="method-signature">
|
651
|
+
<span class="method-name">schema_ref</span><span class="method-args">()</span>
|
652
|
+
</a>
|
653
|
+
</div>
|
654
|
+
|
655
|
+
<div class="method-description">
|
656
|
+
<p>
|
657
|
+
Returns schemaRef element of instance file. schemaRef holds path to
|
658
|
+
taxonomy file for the instance file.
|
659
|
+
</p>
|
660
|
+
<p><a class="source-toggle" href="#"
|
661
|
+
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
662
|
+
<div class="method-source-code" id="M000064-source">
|
663
|
+
<pre>
|
664
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 69</span>
|
665
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">schema_ref</span>
|
666
|
+
<span class="ruby-identifier">base</span> = <span class="ruby-ivar">@xbrl_content</span>[<span class="ruby-value str">"schemaRef"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"xml:base"</span>]
|
667
|
+
<span class="ruby-identifier">href</span> = <span class="ruby-ivar">@xbrl_content</span>[<span class="ruby-value str">"schemaRef"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"xlink:href"</span>]
|
668
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">base</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">href</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span>
|
669
|
+
<span class="ruby-identifier">href</span>
|
670
|
+
<span class="ruby-keyword kw">end</span>
|
671
|
+
</pre>
|
672
|
+
</div>
|
673
|
+
</div>
|
674
|
+
</div>
|
675
|
+
|
676
|
+
<div id="method-M000070" class="method-detail">
|
677
|
+
<a name="M000070"></a>
|
678
|
+
|
679
|
+
<div class="method-heading">
|
680
|
+
<a href="#M000070" class="method-signature">
|
681
|
+
<span class="method-name">unit</span><span class="method-args">(unit_id=nil)</span>
|
682
|
+
</a>
|
683
|
+
</div>
|
684
|
+
|
685
|
+
<div class="method-description">
|
686
|
+
<p>
|
687
|
+
Takes optional unit_id
|
688
|
+
</p>
|
689
|
+
<pre>
|
690
|
+
Returns all units if unit_id is nil
|
691
|
+
Returns matching unit as Unit object if unit_id is given and matching unit found
|
692
|
+
Returns nil if unit_id is given and no matching unit found
|
693
|
+
</pre>
|
694
|
+
<p><a class="source-toggle" href="#"
|
695
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
696
|
+
<div class="method-source-code" id="M000070-source">
|
697
|
+
<pre>
|
698
|
+
<span class="ruby-comment cmt"># File lib/xbrlware/instance.rb, line 228</span>
|
699
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unit</span>(<span class="ruby-identifier">unit_id</span>=<span class="ruby-keyword kw">nil</span>)
|
700
|
+
<span class="ruby-identifier">unit_content</span> = <span class="ruby-ivar">@xbrl_content</span>[<span class="ruby-value str">"unit"</span>]
|
701
|
+
<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">unit_content</span>.<span class="ruby-identifier">nil?</span>
|
702
|
+
|
703
|
+
<span class="ruby-identifier">units</span>=[]
|
704
|
+
|
705
|
+
<span class="ruby-identifier">l</span> = <span class="ruby-identifier">lambda</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">measure_list</span><span class="ruby-operator">|</span> <span class="ruby-identifier">measures</span>=[]; <span class="ruby-identifier">measure_list</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">measure</span><span class="ruby-operator">|</span> <span class="ruby-identifier">measures</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">measure</span>[<span class="ruby-value str">"content"</span>]}; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">measures</span>}
|
706
|
+
<span class="ruby-identifier">unit_content</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">unit</span><span class="ruby-operator">|</span>
|
707
|
+
|
708
|
+
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">unit_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">unit</span>[<span class="ruby-value str">"id"</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">unit_id</span>
|
709
|
+
|
710
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">unit</span>[<span class="ruby-value str">"measure"</span>].<span class="ruby-identifier">nil?</span>
|
711
|
+
<span class="ruby-identifier">units</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Unit</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">unit</span>[<span class="ruby-value str">"id"</span>], <span class="ruby-identifier">l</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">unit</span>[<span class="ruby-value str">"measure"</span>]))
|
712
|
+
<span class="ruby-keyword kw">else</span>
|
713
|
+
<span class="ruby-identifier">divide_content</span> = <span class="ruby-identifier">unit</span>[<span class="ruby-value str">"divide"</span>][<span class="ruby-value">0</span>]
|
714
|
+
|
715
|
+
<span class="ruby-identifier">numerator</span> = <span class="ruby-identifier">l</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">divide_content</span>[<span class="ruby-value str">"unitNumerator"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"measure"</span>])
|
716
|
+
<span class="ruby-identifier">denominator</span> = <span class="ruby-identifier">l</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">divide_content</span>[<span class="ruby-value str">"unitDenominator"</span>][<span class="ruby-value">0</span>][<span class="ruby-value str">"measure"</span>])
|
717
|
+
|
718
|
+
<span class="ruby-identifier">divide</span>=<span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">Divide</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">numerator</span>, <span class="ruby-identifier">denominator</span>)
|
719
|
+
<span class="ruby-identifier">units</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Unit</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">unit</span>[<span class="ruby-value str">"id"</span>], <span class="ruby-identifier">divide</span>)
|
720
|
+
<span class="ruby-keyword kw">end</span>
|
721
|
+
<span class="ruby-keyword kw">end</span>
|
722
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">units</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">unit_id</span>.<span class="ruby-identifier">nil?</span>
|
723
|
+
<span class="ruby-identifier">units</span>
|
724
|
+
<span class="ruby-keyword kw">end</span>
|
725
|
+
</pre>
|
726
|
+
</div>
|
727
|
+
</div>
|
728
|
+
</div>
|
729
|
+
|
730
|
+
|
731
|
+
</div>
|
732
|
+
|
733
|
+
|
734
|
+
</div>
|
735
|
+
|
736
|
+
|
737
|
+
<div id="validator-badges">
|
738
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
739
|
+
</div>
|
740
|
+
|
741
|
+
</body>
|
742
|
+
</html>
|