Class: EverSdk::Utils::AddressStringFormat
- Inherits:
-
Object
- Object
- EverSdk::Utils::AddressStringFormat
- Defined in:
- lib/ever_sdk_client/utils.rb
Overview
types
Constant Summary collapse
- TYPES =
[:account_id, :hex, :base64]
Instance Attribute Summary collapse
-
#bounce ⇒ Object
readonly
Returns the value of attribute bounce.
-
#test_ ⇒ Object
readonly
Returns the value of attribute test_.
-
#type_ ⇒ Object
readonly
Returns the value of attribute type_.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(type_:, url: nil, test_: nil, bounce: nil) ⇒ AddressStringFormat
constructor
A new instance of AddressStringFormat.
- #to_h ⇒ Object
Constructor Details
#initialize(type_:, url: nil, test_: nil, bounce: nil) ⇒ AddressStringFormat
Returns a new instance of AddressStringFormat.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ever_sdk_client/utils.rb', line 12 def initialize(type_:, url: nil, test_: nil, bounce: nil) unless TYPES.include?(type_) raise ArgumentError.new("type #{type_} is unknown; known types: #{TYPES}") end @type_ = type_ if @type_ == :base64 @url = url @test_ = test_ @bounce = bounce end end |
Instance Attribute Details
#bounce ⇒ Object (readonly)
Returns the value of attribute bounce.
10 11 12 |
# File 'lib/ever_sdk_client/utils.rb', line 10 def bounce @bounce end |
#test_ ⇒ Object (readonly)
Returns the value of attribute test_.
10 11 12 |
# File 'lib/ever_sdk_client/utils.rb', line 10 def test_ @test_ end |
#type_ ⇒ Object (readonly)
Returns the value of attribute type_.
10 11 12 |
# File 'lib/ever_sdk_client/utils.rb', line 10 def type_ @type_ end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/ever_sdk_client/utils.rb', line 10 def url @url end |
Instance Method Details
#to_h ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/ever_sdk_client/utils.rb', line 25 def to_h { type: Helper.sym_to_capitalized_case_str(@type_), url: @url, test: @test_, bounce: @bounce } end |