Class: OFX::Data::Declaration

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx/data/declaration.rb

Constant Summary collapse

DEFAULTS =
{
  :"2.0.3" => {ofxheader: "200", version: "203"}
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Declaration

Returns a new instance of Declaration.



18
19
20
21
22
23
24
# File 'lib/ofx/data/declaration.rb', line 18

def initialize(opts)
  @ofxheader = opts.fetch(:ofxheader, "NONE")
  @version = opts.fetch(:version, "NONE")
  @security = opts.fetch(:security, "NONE")
  @oldfileuid = opts.fetch(:oldfileuid, "NONE")
  @newfileuid = opts.fetch(:newfileuid, "NONE")
end

Instance Attribute Details

#newfileuidObject (readonly)

Returns the value of attribute newfileuid.



16
17
18
# File 'lib/ofx/data/declaration.rb', line 16

def newfileuid
  @newfileuid
end

#ofxheaderObject (readonly)

Returns the value of attribute ofxheader.



16
17
18
# File 'lib/ofx/data/declaration.rb', line 16

def ofxheader
  @ofxheader
end

#oldfileuidObject (readonly)

Returns the value of attribute oldfileuid.



16
17
18
# File 'lib/ofx/data/declaration.rb', line 16

def oldfileuid
  @oldfileuid
end

#securityObject (readonly)

Returns the value of attribute security.



16
17
18
# File 'lib/ofx/data/declaration.rb', line 16

def security
  @security
end

#versionObject (readonly)

Returns the value of attribute version.



16
17
18
# File 'lib/ofx/data/declaration.rb', line 16

def version
  @version
end

Class Method Details

.[](key) ⇒ Object



8
9
10
# File 'lib/ofx/data/declaration.rb', line 8

def self.[](key)
  new(DEFAULTS.fetch(key))
end

.defaultObject



12
13
14
# File 'lib/ofx/data/declaration.rb', line 12

def self.default
  self[:"2.0.3"]
end