Class: DeepL::Resources::ResourceFeature

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

Overview

A feature supported by a DeepL API resource, as returned by DeepL::Client#get_language_resources.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feature) ⇒ ResourceFeature

Returns a new instance of ResourceFeature.



12
13
14
15
16
# File 'lib/deepl/resources/language_resource.rb', line 12

def initialize(feature)
  @name = feature['name']
  @needs_source_support = feature['needs_source_support'] ? true : false
  @needs_target_support = feature['needs_target_support'] ? true : false
end

Instance Attribute Details

#name ⇒ Object (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/deepl/resources/language_resource.rb', line 10

def name
  @name
end

Instance Method Details

#needs_source_support? ⇒ Boolean

True if the source language must support this feature for it to be available.

Returns:

  • (Boolean)


23
24
25
# File 'lib/deepl/resources/language_resource.rb', line 23

def needs_source_support?
  @needs_source_support
end

#needs_target_support? ⇒ Boolean

True if the target language must support this feature for it to be available.

Returns:

  • (Boolean)


28
29
30
# File 'lib/deepl/resources/language_resource.rb', line 28

def needs_target_support?
  @needs_target_support
end

#to_s ⇒ Object



18
19
20
# File 'lib/deepl/resources/language_resource.rb', line 18

def to_s
  name
end