Class: EverSdk::Boc::BocCacheType
- Inherits:
-
Object
- Object
- EverSdk::Boc::BocCacheType
- Defined in:
- lib/ever_sdk_client/boc.rb
Constant Summary collapse
- TYPES =
[ :pinned, :unpinned ]
Instance Attribute Summary collapse
-
#pin ⇒ Object
readonly
Returns the value of attribute pin.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, pin: nil) ⇒ BocCacheType
constructor
A new instance of BocCacheType.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, pin: nil) ⇒ BocCacheType
Returns a new instance of BocCacheType.
34 35 36 37 38 39 40 |
# File 'lib/ever_sdk_client/boc.rb', line 34 def initialize(type:, pin: nil) unless TYPES.include?(type) raise ArgumentError.new("type #{type} is unknown; known types: #{TYPES}") end @type = type @pin = pin end |
Instance Attribute Details
#pin ⇒ Object (readonly)
Returns the value of attribute pin.
32 33 34 |
# File 'lib/ever_sdk_client/boc.rb', line 32 def pin @pin end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
32 33 34 |
# File 'lib/ever_sdk_client/boc.rb', line 32 def type @type end |
Instance Method Details
#to_h ⇒ Object
42 43 44 45 46 |
# File 'lib/ever_sdk_client/boc.rb', line 42 def to_h hash = {type: Helper.sym_to_capitalized_case_str(type)} hash[:pin] = pin if type == :pinned hash end |