Method: OSDNClient::Release#initialize

Defined in:
lib/osdn-client/models/release.rb

#initialize(attributes = {}) ⇒ Release

Returns a new instance of Release.


64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/osdn-client/models/release.rb', line 64

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

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

  
  if attributes[:'id']
    self.id = attributes[:'id']
  end
  
  if attributes[:'name']
    self.name = attributes[:'name']
  end
  
  if attributes[:'url']
    self.url = attributes[:'url']
  end
  
  if attributes[:'visibility']
    self.visibility = attributes[:'visibility']
  end
  
  if attributes[:'cascaded_visibility']
    self.cascaded_visibility = attributes[:'cascaded_visibility']
  end
  
  if attributes[:'package_id']
    self.package_id = attributes[:'package_id']
  end
  
  if attributes[:'file_count']
    self.file_count = attributes[:'file_count']
  end
  
  if attributes[:'is_draft']
    self.is_draft = attributes[:'is_draft']
  end
  
  if attributes[:'files']
    if (value = attributes[:'files']).is_a?(Array)
      self.files = value
    end
  end
  
end