Class: Xbrlware::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/xbrlware-extras/factory.rb

Class Method Summary collapse

Class Method Details

.Calculation(args = {}) ⇒ Object



50
51
52
53
54
55
56
57
58
59
# File 'lib/xbrlware-extras/factory.rb', line 50

def self.Calculation(args = {})
  entity_details=nil
  title=args[:title] || ""
  role=args[:role]
  href=nil
  arcs=args[:arcs] || []
  contexts=nil

  return Xbrlware::Linkbase::CalculationLinkbase::Calculation.new(entity_details, title, role, href, arcs, contexts)
end

.CalculationArc(args = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/xbrlware-extras/factory.rb', line 34

def self.CalculationArc(args = {})
  item_id = args[:item_id] || ""
  href = ""
  role = nil
  order = nil
  weight = nil
  priority = nil
  use = nil
  label = args[:label] || ""

  arc = Xbrlware::Linkbase::CalculationLinkbase::Calculation::CalculationArc.new(item_id, href, role, order, 
                                                                                 weight, priority, use, label)

  return arc
end

.Context(args = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/xbrlware-extras/factory.rb', line 9

def self.Context(args = {})
  id = args[:id] || ""
  entity = args[:entity] || self.Entity()
  period = args[:period]
  scenario = args[:scenario]
  context = Xbrlware::Context.new(id, entity, period, scenario)

  return context
end

.Entity(args = {}) ⇒ Object



3
4
5
6
7
# File 'lib/xbrlware-extras/factory.rb', line 3

def self.Entity(args = {})
  entity = Xbrlware::Entity.new(args[:identifier], args[:segment])

  return entity
end

.Item(args = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/xbrlware-extras/factory.rb', line 19

def self.Item(args = {})
  instance = nil
  name = args[:name] || ""
  context = args[:context] || self.Context(:period => args[:period])
  value = args[:value] || ""
  unit = args[:unit]
  precision = args[:precision]
  decimals = args[:decimals] || "-6"
  footnotes = nil
  
  item = Xbrlware::Item.new(instance, name, context, value, unit, precision, decimals, footnotes)

  return item
end