Class: Gapic::PathPattern::CollectionIdSegment
- Inherits:
-
Object
- Object
- Gapic::PathPattern::CollectionIdSegment
- Defined in:
- lib/gapic/path_pattern/segment.rb
Overview
A CollectionId segment in a path template. CollectionId segments are basically string literals
Instance Attribute Summary collapse
-
#pattern ⇒ String
readonly
The pattern of the segment, for the positional segment it is also a pattern of its resource.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(pattern) ⇒ CollectionIdSegment
constructor
A new instance of CollectionIdSegment.
-
#nontrivial_resource_pattern? ⇒ Boolean
Whether the segment provides a nontrivial resource pattern.
-
#path_string ⇒ String
Path string for this segment.
-
#pattern_template ⇒ String
A pattern template for this segment.
-
#positional? ⇒ Boolean
Whether the segment is positional.
-
#provides_arguments? ⇒ Boolean
Whether the segment provides arguments.
-
#resource_pattern? ⇒ Boolean
Whether the segment provides a resource pattern.
Constructor Details
#initialize(pattern) ⇒ CollectionIdSegment
Returns a new instance of CollectionIdSegment.
228 229 230 231 |
# File 'lib/gapic/path_pattern/segment.rb', line 228 def initialize pattern @type = :collection_id @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ String (readonly)
Returns The pattern of the segment, for the positional segment it is also a pattern of its resource.
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/gapic/path_pattern/segment.rb', line 224 class CollectionIdSegment attr_reader :type attr_reader :pattern def initialize pattern @type = :collection_id @pattern = pattern end ## # Whether the segment is positional # @return [Boolean] def positional? false end ## # Whether the segment provides a resource pattern # @return [Boolean] def resource_pattern? false end ## # Whether the segment provides a nontrivial resource pattern # @return [Boolean] def nontrivial_resource_pattern? false end ## # Whether the segment provides arguments # @return [Boolean] def provides_arguments? false end ## # Path string for this segment # @return [String] def path_string pattern end ## # A pattern template for this segment # @return [String] def pattern_template pattern end # @private def == other return false unless other.is_a? self.class (pattern == other.pattern) end end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
225 226 227 |
# File 'lib/gapic/path_pattern/segment.rb', line 225 def type @type end |
Instance Method Details
#nontrivial_resource_pattern? ⇒ Boolean
Whether the segment provides a nontrivial resource pattern
250 251 252 |
# File 'lib/gapic/path_pattern/segment.rb', line 250 def nontrivial_resource_pattern? false end |
#path_string ⇒ String
Path string for this segment
264 265 266 |
# File 'lib/gapic/path_pattern/segment.rb', line 264 def path_string pattern end |
#pattern_template ⇒ String
A pattern template for this segment
271 272 273 |
# File 'lib/gapic/path_pattern/segment.rb', line 271 def pattern_template pattern end |
#positional? ⇒ Boolean
Whether the segment is positional
236 237 238 |
# File 'lib/gapic/path_pattern/segment.rb', line 236 def positional? false end |
#provides_arguments? ⇒ Boolean
Whether the segment provides arguments
257 258 259 |
# File 'lib/gapic/path_pattern/segment.rb', line 257 def provides_arguments? false end |
#resource_pattern? ⇒ Boolean
Whether the segment provides a resource pattern
243 244 245 |
# File 'lib/gapic/path_pattern/segment.rb', line 243 def resource_pattern? false end |