Class: Decidim::Etherpad::Pad
- Inherits:
 - 
      Object
      
        
- Object
 - Decidim::Etherpad::Pad
 
 
- Defined in:
 - lib/decidim/etherpad/pad.rb
 
Overview
This class allows you to interact with pad stored in an Etherpad Lite server.
Instance Attribute Summary collapse
- 
  
    
      #id  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute id.
 
Instance Method Summary collapse
- 
  
    
      #initialize(pad_id)  ⇒ Pad 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Pad.
 - 
  
    
      #read_only_id  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Read only means that pad is not writable.
 - #text ⇒ Object
 
Constructor Details
#initialize(pad_id) ⇒ Pad
Returns a new instance of Pad.
      7 8 9 10 11 12  | 
    
      # File 'lib/decidim/etherpad/pad.rb', line 7 def initialize(pad_id) @id = pad_id @api_key = Decidim.etherpad.fetch(:api_key) @api_version = Decidim.etherpad.fetch(:api_version, "1.2.1") @uri = URI.parse(Decidim.etherpad.fetch(:server)) end  | 
  
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
      14 15 16  | 
    
      # File 'lib/decidim/etherpad/pad.rb', line 14 def id @id end  | 
  
Instance Method Details
#read_only_id ⇒ Object
Read only means that pad is not writable.
      17 18 19  | 
    
      # File 'lib/decidim/etherpad/pad.rb', line 17 def read_only_id @read_only_id ||= resolve(:getReadOnlyID, { padID: id })[:readOnlyID] end  | 
  
#text ⇒ Object
      21 22 23  | 
    
      # File 'lib/decidim/etherpad/pad.rb', line 21 def text resolve(:getText, { padID: id })[:text] end  |