Class: ThreeUsage::UsageBlock
- Inherits:
-
Object
- Object
- ThreeUsage::UsageBlock
- Defined in:
- lib/three_usage/usage_block.rb
Instance Attribute Summary collapse
-
#block_type ⇒ Object
readonly
Returns the value of attribute block_type.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
Instance Method Summary collapse
-
#initialize(options) ⇒ UsageBlock
constructor
A new instance of UsageBlock.
Constructor Details
#initialize(options) ⇒ UsageBlock
Returns a new instance of UsageBlock.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/three_usage/usage_block.rb', line 4 def initialize() @description = [:description] @remaining = [:remaining].to_f @expires_at = Date.strptime([:expires_at], '%d/%m/%y') @block_type = case @description when 'Prepaid Mobile Broadband (On Net)', 'Prepaid Initial Activation Data (On Net)' :three when 'Prepaid Roaming Mobile Broadband' :roaming else :unknown end end |
Instance Attribute Details
#block_type ⇒ Object (readonly)
Returns the value of attribute block_type.
3 4 5 |
# File 'lib/three_usage/usage_block.rb', line 3 def block_type @block_type end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/three_usage/usage_block.rb', line 3 def description @description end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
3 4 5 |
# File 'lib/three_usage/usage_block.rb', line 3 def expires_at @expires_at end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
3 4 5 |
# File 'lib/three_usage/usage_block.rb', line 3 def remaining @remaining end |