class AzureSTT::Parsers::Base

Base class for the parsers

Attributes

hash[R]

Public Class Methods

new(hash) click to toggle source

Initialize the parser

@param [Hash] hash The hash containing the information from the API

# File lib/azure_stt/parsers/base.rb, line 16
def initialize(hash)
  @hash = hash
end

Public Instance Methods

attributes() click to toggle source

Get the attributes parsed to be able to build the model

@return [Hash]

# File lib/azure_stt/parsers/base.rb, line 25
def attributes
  @attributes ||= build_attributes
end

Protected Instance Methods

build_attributes() click to toggle source

This method must be overriden in the children

@return [Hash] The attributes parsed to be able to build the model

# File lib/azure_stt/parsers/base.rb, line 36
def build_attributes
  raise NoMethodError, 'Implement method #build_attributes in your' \
                       'custom parser'
end