Class: DeepL::Resources::CustomTagUsage

Inherits:
Object
  • Object
show all
Defined in:
lib/deepl/resources/custom_tag_usage_report.rb

Overview

Usage of a single custom tag. usage_date is only set when aggregated by day.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(usage) ⇒ CustomTagUsage

Returns a new instance of CustomTagUsage.



34
35
36
37
38
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 34

def initialize(usage)
  @custom_tag = usage['custom_tag'].is_a?(String) ? usage['custom_tag'] : ''
  @breakdown = CustomTagUsageBreakdown.new(usage['breakdown'])
  @usage_date = Utils::TimeParser.parse_optional_utc_time(usage['usage_date'])
end

Instance Attribute Details

#breakdown ⇒ Object (readonly)

Returns the value of attribute breakdown.



32
33
34
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 32

def breakdown
  @breakdown
end

#custom_tag ⇒ Object (readonly)

Returns the value of attribute custom_tag.



32
33
34
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 32

def custom_tag
  @custom_tag
end

#usage_date ⇒ Object (readonly)

Returns the value of attribute usage_date.



32
33
34
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 32

def usage_date
  @usage_date
end