Class: EMTypographer

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

Constant Summary collapse

TYPOGRAPHER_REQUEST_URI =
URI('http://mdash.ru/api.v1.php')

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#textObject

Returns the value of attribute text.



7
8
9
# File 'lib/e_m_typographer.rb', line 7

def text
  @text
end

Instance Method Details

#applyObject



9
10
11
12
13
# File 'lib/e_m_typographer.rb', line 9

def apply
  response = send_typographer_post_request(text)

  JSON.parse(response.body)['result'] if response && response.body['result']
end