Class: Atnd4r::AtndEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/atnd4r.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ AtndEvent

XML オブジェクト



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/atnd4r.rb', line 183

def initialize(event)
  # 共通データ
  @accepted = AtndAPIUtil::to_ruby_type event.elements['accepted']
  @event_id = AtndAPIUtil::to_ruby_type event.elements['event-id']
  @updated_at = AtndAPIUtil::to_ruby_type event.elements['updated-at']
  @title = AtndAPIUtil::to_ruby_type event.elements['title']
  @waiting = AtndAPIUtil::to_ruby_type event.elements['waiting']
  @event_url = AtndAPIUtil::to_ruby_type event.elements['event-url']
  @limit = AtndAPIUtil::to_ruby_type event.elements['limit']
  
  # 出席情報の場合
  @users = []
  event.elements.each('users/user') do |user|
    @users << AtndUser.new(user)
  end
  
  # イベント情報の場合
  @place = AtndAPIUtil::to_ruby_type event.elements['place']
  @lon = AtndAPIUtil::to_ruby_type event.elements['lon']
  @ended_at = AtndAPIUtil::to_ruby_type event.elements['ended-at']
  @url = AtndAPIUtil::to_ruby_type event.elements['url']
  @owner_nickname = AtndAPIUtil::to_ruby_type event.elements['owner-nickname']
  @catch = AtndAPIUtil::to_ruby_type event.elements['catch']
  @description = AtndAPIUtil::to_ruby_type event.elements['description']
  @owner_id = AtndAPIUtil::to_ruby_type event.elements['owner-id']
  @lat = AtndAPIUtil::to_ruby_type event.elements['lat']
  @address = AtndAPIUtil::to_ruby_type event.elements['address']
  @started_at = AtndAPIUtil::to_ruby_type event.elements['started-at']
end

Instance Attribute Details

#acceptedObject (readonly)

Returns the value of attribute accepted.



213
214
215
# File 'lib/atnd4r.rb', line 213

def accepted
  @accepted
end

#addressObject (readonly)

Returns the value of attribute address.



215
216
217
# File 'lib/atnd4r.rb', line 215

def address
  @address
end

#catchObject (readonly)

Returns the value of attribute catch.



215
216
217
# File 'lib/atnd4r.rb', line 215

def catch
  @catch
end

#descriptionObject (readonly)

Returns the value of attribute description.



215
216
217
# File 'lib/atnd4r.rb', line 215

def description
  @description
end

#ended_atObject (readonly)

Returns the value of attribute ended_at.



215
216
217
# File 'lib/atnd4r.rb', line 215

def ended_at
  @ended_at
end

#event_idObject (readonly)

Returns the value of attribute event_id.



213
214
215
# File 'lib/atnd4r.rb', line 213

def event_id
  @event_id
end

#event_urlObject (readonly)

Returns the value of attribute event_url.



213
214
215
# File 'lib/atnd4r.rb', line 213

def event_url
  @event_url
end

#latObject (readonly)

Returns the value of attribute lat.



215
216
217
# File 'lib/atnd4r.rb', line 215

def lat
  @lat
end

#limitObject (readonly)

Returns the value of attribute limit.



213
214
215
# File 'lib/atnd4r.rb', line 213

def limit
  @limit
end

#lonObject (readonly)

Returns the value of attribute lon.



215
216
217
# File 'lib/atnd4r.rb', line 215

def lon
  @lon
end

#owner_idObject (readonly)

Returns the value of attribute owner_id.



215
216
217
# File 'lib/atnd4r.rb', line 215

def owner_id
  @owner_id
end

#owner_nicknameObject (readonly)

Returns the value of attribute owner_nickname.



215
216
217
# File 'lib/atnd4r.rb', line 215

def owner_nickname
  @owner_nickname
end

#placeObject (readonly)

Returns the value of attribute place.



215
216
217
# File 'lib/atnd4r.rb', line 215

def place
  @place
end

#started_atObject (readonly)

Returns the value of attribute started_at.



215
216
217
# File 'lib/atnd4r.rb', line 215

def started_at
  @started_at
end

#titleObject (readonly)

Returns the value of attribute title.



213
214
215
# File 'lib/atnd4r.rb', line 213

def title
  @title
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



213
214
215
# File 'lib/atnd4r.rb', line 213

def updated_at
  @updated_at
end

#urlObject (readonly)

Returns the value of attribute url.



215
216
217
# File 'lib/atnd4r.rb', line 215

def url
  @url
end

#usersObject (readonly)

Returns the value of attribute users.



214
215
216
# File 'lib/atnd4r.rb', line 214

def users
  @users
end

#waitingObject (readonly)

Returns the value of attribute waiting.



213
214
215
# File 'lib/atnd4r.rb', line 213

def waiting
  @waiting
end