Class: AgridClient::Service

Inherits:
Object
  • Object
show all
Includes:
SwaggerModel
Defined in:
lib/agrid_client/models/service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SwaggerModel

#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash

Constructor Details

#initialize(attributes = {}) ⇒ Service

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/agrid_client/models/service.rb', line 54

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes[:'id']
    self.id = attributes[:'id']
  end
  if attributes[:'title']
    self.title = attributes[:'title']
  end
  if attributes[:'online']
    self.online = attributes[:'online']
  end
  if attributes[:'tags']
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  end
end

Instance Attribute Details

#idObject

Unique Id



21
22
23
# File 'lib/agrid_client/models/service.rb', line 21

def id
  @id
end

#onlineObject

Describes if the service is online or not



27
28
29
# File 'lib/agrid_client/models/service.rb', line 27

def online
  @online
end

#tagsObject

Tags used to categorize service



30
31
32
# File 'lib/agrid_client/models/service.rb', line 30

def tags
  @tags
end

#titleObject

Service title



24
25
26
# File 'lib/agrid_client/models/service.rb', line 24

def title
  @title
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



33
34
35
36
37
38
39
40
# File 'lib/agrid_client/models/service.rb', line 33

def self.attribute_map
  {
    :'id' => :'id',
    :'title' => :'title',
    :'online' => :'online',
    :'tags' => :'tags'
  }
end

.swagger_typesObject

Attribute type mapping.



43
44
45
46
47
48
49
50
# File 'lib/agrid_client/models/service.rb', line 43

def self.swagger_types
  {
    :'id' => :'String',
    :'title' => :'String',
    :'online' => :'BOOLEAN',
    :'tags' => :'Array<String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



78
79
80
81
82
# File 'lib/agrid_client/models/service.rb', line 78

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


86
87
88
# File 'lib/agrid_client/models/service.rb', line 86

def eql?(o)
  self == o
end