Class: Todoloo::Task

Inherits:
Struct
  • Object
show all
Defined in:
lib/todoloo/task.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnObject

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



2
3
4
# File 'lib/todoloo/task.rb', line 2

def column
  @column
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



2
3
4
# File 'lib/todoloo/task.rb', line 2

def description
  @description
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



2
3
4
# File 'lib/todoloo/task.rb', line 2

def line
  @line
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



2
3
4
# File 'lib/todoloo/task.rb', line 2

def path
  @path
end

#topicsObject

Returns the value of attribute topics

Returns:

  • (Object)

    the current value of topics



2
3
4
# File 'lib/todoloo/task.rb', line 2

def topics
  @topics
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



2
3
4
# File 'lib/todoloo/task.rb', line 2

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/todoloo/task.rb', line 3

def self.from_hash(hash)
  new(
    hash.fetch(:type),
    hash.fetch(:topics),
    hash.fetch(:description),
    hash.fetch(:path),
    hash.fetch(:line),
    hash.fetch(:column)
  )
end

Instance Method Details

#locationObject



14
15
16
# File 'lib/todoloo/task.rb', line 14

def location
  "#{path}:#{line}:#{column}"
end