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"},
  :"1.0.2" => {ofxheader: "100", version: "102"}
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Declaration

Returns a new instance of Declaration.



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

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

Instance Attribute Details

#encodingObject (readonly)

Returns the value of attribute encoding.



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

def encoding
  @encoding
end

#newfileuidObject (readonly)

Returns the value of attribute newfileuid.



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

def newfileuid
  @newfileuid
end

#ofxheaderObject (readonly)

Returns the value of attribute ofxheader.



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

def ofxheader
  @ofxheader
end

#oldfileuidObject (readonly)

Returns the value of attribute oldfileuid.



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

def oldfileuid
  @oldfileuid
end

#securityObject (readonly)

Returns the value of attribute security.



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

def security
  @security
end

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

Class Method Details

.[](key) ⇒ Object



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

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

.defaultObject



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

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