Class: Gapic::Model::Mixins::Mixin

Inherits:
Object
  • Object
show all
Defined in:
lib/gapic/model/mixins.rb

Overview

Model of a single mixin service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, dependency, require_str, client_class_name, client_var_name) ⇒ Mixin

Returns a new instance of Mixin.

Parameters:

  • service (String)

    Full name of the service

  • dependency (Hash<String, String>)

    Service dependencies, in the { gem_name => version pattern } format

  • require_str (String)

    Path to require the client of the service

  • client_class_name (String)

    Full name of the class of the client of the service

  • client_var_name (String)

    Name for the variable for the client of the mixin service to use when generating library's service



110
111
112
113
114
115
116
117
# File 'lib/gapic/model/mixins.rb', line 110

def initialize service, dependency, require_str, client_class_name, client_var_name
  @service = service
  @dependency = dependency
  @require_str = require_str
  @client_class_name = client_class_name
  @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
  @client_var_name = client_var_name
end

Instance Attribute Details

#client_class_docnameString (readonly)

Name of the class as it should appear in the documentation

Returns:

  • (String)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/gapic/model/mixins.rb', line 90

class Mixin
  attr_reader :service
  attr_reader :dependency
  attr_reader :require_str
  attr_reader :client_class_name
  attr_reader :client_class_docname
  attr_reader :client_var_name

  # @param service [String]
  #   Full name of the service
  # @param dependency [Hash<String, String>]
  #   Service dependencies, in the
  #   `{ gem_name => version pattern }` format
  # @param require_str [String]
  #   Path to require the client of the service
  # @param client_class_name [String]
  #   Full name of the class of the client of the service
  # @param client_var_name [String]
  #   Name for the variable for the client of the mixin service
  #   to use when generating library's service
  def initialize service, dependency, require_str, client_class_name, client_var_name
    @service = service
    @dependency = dependency
    @require_str = require_str
    @client_class_name = client_class_name
    @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
    @client_var_name = client_var_name
  end

  # @return [String] The description to place in the comments to the
  #   mixin's attribute in the library services's client class
  def service_description
    "mix-in of the #{client_class_name.split('::')[-2]}"
  end
end

#client_class_nameString (readonly)

Full name of the class of the client of the service

Returns:

  • (String)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/gapic/model/mixins.rb', line 90

class Mixin
  attr_reader :service
  attr_reader :dependency
  attr_reader :require_str
  attr_reader :client_class_name
  attr_reader :client_class_docname
  attr_reader :client_var_name

  # @param service [String]
  #   Full name of the service
  # @param dependency [Hash<String, String>]
  #   Service dependencies, in the
  #   `{ gem_name => version pattern }` format
  # @param require_str [String]
  #   Path to require the client of the service
  # @param client_class_name [String]
  #   Full name of the class of the client of the service
  # @param client_var_name [String]
  #   Name for the variable for the client of the mixin service
  #   to use when generating library's service
  def initialize service, dependency, require_str, client_class_name, client_var_name
    @service = service
    @dependency = dependency
    @require_str = require_str
    @client_class_name = client_class_name
    @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
    @client_var_name = client_var_name
  end

  # @return [String] The description to place in the comments to the
  #   mixin's attribute in the library services's client class
  def service_description
    "mix-in of the #{client_class_name.split('::')[-2]}"
  end
end

#client_var_nameString (readonly)

Name for the variable for the client of the mixin service to use when generating library's service

Returns:

  • (String)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/gapic/model/mixins.rb', line 90

class Mixin
  attr_reader :service
  attr_reader :dependency
  attr_reader :require_str
  attr_reader :client_class_name
  attr_reader :client_class_docname
  attr_reader :client_var_name

  # @param service [String]
  #   Full name of the service
  # @param dependency [Hash<String, String>]
  #   Service dependencies, in the
  #   `{ gem_name => version pattern }` format
  # @param require_str [String]
  #   Path to require the client of the service
  # @param client_class_name [String]
  #   Full name of the class of the client of the service
  # @param client_var_name [String]
  #   Name for the variable for the client of the mixin service
  #   to use when generating library's service
  def initialize service, dependency, require_str, client_class_name, client_var_name
    @service = service
    @dependency = dependency
    @require_str = require_str
    @client_class_name = client_class_name
    @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
    @client_var_name = client_var_name
  end

  # @return [String] The description to place in the comments to the
  #   mixin's attribute in the library services's client class
  def service_description
    "mix-in of the #{client_class_name.split('::')[-2]}"
  end
end

#dependencyHash<String, String> (readonly)

Service dependencies, in the { gem_name => version pattern } format

Returns:

  • (Hash<String, String>)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/gapic/model/mixins.rb', line 90

class Mixin
  attr_reader :service
  attr_reader :dependency
  attr_reader :require_str
  attr_reader :client_class_name
  attr_reader :client_class_docname
  attr_reader :client_var_name

  # @param service [String]
  #   Full name of the service
  # @param dependency [Hash<String, String>]
  #   Service dependencies, in the
  #   `{ gem_name => version pattern }` format
  # @param require_str [String]
  #   Path to require the client of the service
  # @param client_class_name [String]
  #   Full name of the class of the client of the service
  # @param client_var_name [String]
  #   Name for the variable for the client of the mixin service
  #   to use when generating library's service
  def initialize service, dependency, require_str, client_class_name, client_var_name
    @service = service
    @dependency = dependency
    @require_str = require_str
    @client_class_name = client_class_name
    @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
    @client_var_name = client_var_name
  end

  # @return [String] The description to place in the comments to the
  #   mixin's attribute in the library services's client class
  def service_description
    "mix-in of the #{client_class_name.split('::')[-2]}"
  end
end

#require_strString (readonly)

Path to require the client of the service

Returns:

  • (String)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/gapic/model/mixins.rb', line 90

class Mixin
  attr_reader :service
  attr_reader :dependency
  attr_reader :require_str
  attr_reader :client_class_name
  attr_reader :client_class_docname
  attr_reader :client_var_name

  # @param service [String]
  #   Full name of the service
  # @param dependency [Hash<String, String>]
  #   Service dependencies, in the
  #   `{ gem_name => version pattern }` format
  # @param require_str [String]
  #   Path to require the client of the service
  # @param client_class_name [String]
  #   Full name of the class of the client of the service
  # @param client_var_name [String]
  #   Name for the variable for the client of the mixin service
  #   to use when generating library's service
  def initialize service, dependency, require_str, client_class_name, client_var_name
    @service = service
    @dependency = dependency
    @require_str = require_str
    @client_class_name = client_class_name
    @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
    @client_var_name = client_var_name
  end

  # @return [String] The description to place in the comments to the
  #   mixin's attribute in the library services's client class
  def service_description
    "mix-in of the #{client_class_name.split('::')[-2]}"
  end
end

#serviceString (readonly)

Full name of the service

Returns:

  • (String)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/gapic/model/mixins.rb', line 90

class Mixin
  attr_reader :service
  attr_reader :dependency
  attr_reader :require_str
  attr_reader :client_class_name
  attr_reader :client_class_docname
  attr_reader :client_var_name

  # @param service [String]
  #   Full name of the service
  # @param dependency [Hash<String, String>]
  #   Service dependencies, in the
  #   `{ gem_name => version pattern }` format
  # @param require_str [String]
  #   Path to require the client of the service
  # @param client_class_name [String]
  #   Full name of the class of the client of the service
  # @param client_var_name [String]
  #   Name for the variable for the client of the mixin service
  #   to use when generating library's service
  def initialize service, dependency, require_str, client_class_name, client_var_name
    @service = service
    @dependency = dependency
    @require_str = require_str
    @client_class_name = client_class_name
    @client_class_docname = client_class_name # For mixins, the doc name should be the full class name
    @client_var_name = client_var_name
  end

  # @return [String] The description to place in the comments to the
  #   mixin's attribute in the library services's client class
  def service_description
    "mix-in of the #{client_class_name.split('::')[-2]}"
  end
end

Instance Method Details

#service_descriptionString

Returns The description to place in the comments to the mixin's attribute in the library services's client class.

Returns:

  • (String)

    The description to place in the comments to the mixin's attribute in the library services's client class



121
122
123
# File 'lib/gapic/model/mixins.rb', line 121

def service_description
  "mix-in of the #{client_class_name.split('::')[-2]}"
end