Class: Dev::BloomGrowth::Rock

Inherits:
Object
  • Object
show all
Defined in:
lib/firespring_dev_commands/bloom_growth/rock.rb

Overview

Class containing rock information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Rock

Returns a new instance of Rock.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 8

def initialize(data)
  @data = data
  @id = data['Id']
  @type = data['Type']
  @name = data['Name'].to_s.strip
  @owner = User.new(data['Owner']) if data['Owner']
  @complete = data['Complete']
  @completion_id = data['Completion']
  @created = Time.parse(data['CreateTime']) if data['CreateTime']
  @due = Time.parse(data['DueDate']) if data['DueDate']
  @archived = data['Archived']
end

Instance Attribute Details

#completeObject

Returns the value of attribute complete.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def complete
  @complete
end

#completion_idObject

Returns the value of attribute completion_id.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def completion_id
  @completion_id
end

#createdObject

Returns the value of attribute created.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def created
  @created
end

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def data
  @data
end

#dueObject

Returns the value of attribute due.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def due
  @due
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def id
  @id
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def owner
  @owner
end

#stateObject (readonly)

Convert the completion_id bloom growth gives us into a text version



22
23
24
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 22

def state
  @state
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/firespring_dev_commands/bloom_growth/rock.rb', line 5

def type
  @type
end