Class: Youroom::AddRoom
- Defined in:
- lib/youroom_api/request/add_room.rb
Instance Attribute Summary collapse
-
#billing_id ⇒ Object
readonly
Returns the value of attribute billing_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Request
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(access_token, billing_id, name, url = BASE_URL) ⇒ AddRoom
constructor
A new instance of AddRoom.
- #params ⇒ Object
- #path ⇒ Object
Methods inherited from Request
#create_entry, #create_participation, #create_room, #create_user, #delete, #destroy_entry, #destroy_participation, #get, #get_all_timeline, #get_attachment, #get_entry, #get_my_group, #get_picture, #get_room_list, #get_room_timeline, #get_unread_timeline, #get_user_list, #get_verify_credentials, #mark_read, #mark_unread, #post
Constructor Details
#initialize(access_token, billing_id, name, url = BASE_URL) ⇒ AddRoom
Returns a new instance of AddRoom.
5 6 7 8 9 10 |
# File 'lib/youroom_api/request/add_room.rb', line 5 def initialize(access_token, billing_id, name, url=BASE_URL) required_structure(billing_id, String, Fixnum) required_structure(name, String, Symbol) @billing_id, @name = billing_id.to_s, name.to_s super(access_token, url) end |
Instance Attribute Details
#billing_id ⇒ Object (readonly)
Returns the value of attribute billing_id.
3 4 5 |
# File 'lib/youroom_api/request/add_room.rb', line 3 def billing_id @billing_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/youroom_api/request/add_room.rb', line 3 def name @name end |
Instance Method Details
#params ⇒ Object
16 17 18 |
# File 'lib/youroom_api/request/add_room.rb', line 16 def params { :billing_group => { :group_attributes => { :name => name } } }.optimize end |
#path ⇒ Object
12 13 14 |
# File 'lib/youroom_api/request/add_room.rb', line 12 def path File.join(url, 'billings', billing_id, 'billing_groups?format=json') end |