Class: Xbrlware::ValueMapping
- Inherits:
-
Object
- Object
- Xbrlware::ValueMapping
- Defined in:
- lib/xbrlware-extras/item.rb
Instance Attribute Summary collapse
-
#policy ⇒ Object
Returns the value of attribute policy.
Instance Method Summary collapse
-
#initialize ⇒ ValueMapping
constructor
A new instance of ValueMapping.
- #value(name, defn, val) ⇒ Object
Constructor Details
#initialize ⇒ ValueMapping
Returns a new instance of ValueMapping.
6 7 8 9 10 11 12 |
# File 'lib/xbrlware-extras/item.rb', line 6 def initialize @unknown_classifier = nil @policy = { :credit => :no_action, :debit => :no_action, :unknown => :no_action } # FIXME: a classifier could be used here.... end |
Instance Attribute Details
#policy ⇒ Object
Returns the value of attribute policy.
4 5 6 |
# File 'lib/xbrlware-extras/item.rb', line 4 def policy @policy end |
Instance Method Details
#value(name, defn, val) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/xbrlware-extras/item.rb', line 14 def value(name, defn, val) # we ignore 'name' in this implementation case @policy[defn] when :no_action then val when :flip then -val end end |