Class: Pastee::Syntax

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Syntax

Creates a new object representing a Syntax on the Pastee website.

Parameters:

  • opts (Hash<String, Object>) (defaults to: {})

    The options hash. This is usually obtained by the Pastee API.

Options Hash (opts):

  • 'id' (Integer)

    The integer ID for this syntax.

  • 'short' (String)

    The shortened name for the syntax.

  • 'name' (String)

    The full name for the syntax.



17
18
19
20
21
# File 'lib/pastee/syntax.rb', line 17

def initialize(opts = {})
  @id = opts['id']
  @short_name = opts['short']
  @full_name = opts['name']
end

Instance Attribute Details

#full_nameString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/pastee/syntax.rb', line 10

def full_name
  @full_name
end

#idInteger (readonly)

Returns:

  • (Integer)


4
5
6
# File 'lib/pastee/syntax.rb', line 4

def id
  @id
end

#short_nameString (readonly)

Returns:

  • (String)


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

def short_name
  @short_name
end